Skip to main content

Signature and Bigraphs

We start with a dynamic signature and two initial models. Namely, a drone part and a variable space part:

private DynamicSignature sig() {
return pureSignatureBuilder()
.add("Drone", 0)
.add("VarSpace", 0)
.add("HIGH", 0)
.add("MEDIUM", 0)
.add("LOW", 0)
.add("EnergyD", 0)
.add("EnergyC", 0)
.add("Ref", 1)
.add("Var", 1)
.add("Ni", 0) //represents an integer
.create();
}

One part of the model describes the drone and its energy state, the other part describes a "variable space" holding a small node Ni with a runtime attribute key that we will fill from ROS2 messages.

Variable space

private PureBigraph varModel()
throws InvalidConnectionException, TypeNotExistsException {
return pureBuilder(sig())
.root().child("VarSpace").down()
.child("Var").linkOuter("eref").down().child("Ni")
.create();
}

Drone

private PureBigraph droneModel()
throws InvalidConnectionException, TypeNotExistsException {
return pureBuilder(sig())
.root().child("Drone").down()
.child("EnergyC").down().child("Ref").linkOuter("eref").up()
.child("EnergyD").down().child("HIGH")
.create();
}

The name eref is declared as a shared outer name. It serves as a provided interface, allowing separately created bigraph fragments to be composed.

At this point you can already render or export both bigraphs to verify their structure (e.g., as XMI or DOT).