The Signature
SSR uses a combined signature of the grid and robots.
// Robot controls
public DefaultDynamicSignature createRobotSignature() {
DynamicSignatureBuilder b = pureSignatureBuilder();
b.addControl("WayPoint", 1)
.addControl("OccupiedBy", 0)
.addControl("Robot", 1)
.addControl("ID", 0)
.addControl("N0", 0).addControl("N1", 0).addControl("N2", 0)
.addControl("N3", 0).addControl("N4", 0).addControl("N5", 0)
.addControl("Bat", 0).addControl("Pow", 0)
.addControl("SLck", 0).addControl("SLckRef", 1)
.addControl("Mvmt", 0).addControl("Token", 0);
return b.create();
}
The full signature merges the grid Ecore/XMI with the robot controls:
public DefaultDynamicSignature getCombinedSystemSignature() throws IOException {
List<EObject> sigEObjects = BigraphFileModelManagement.Load
.signatureInstanceModel(
"src/test/resources/models/selfsortingrobots/mm_sig_loc.ecore",
"src/test/resources/models/selfsortingrobots/sig_loc.xmi"
);
AbstractEcoreSignature<?> locSig = createOrGetSignature(sigEObjects.get(0));
return BigraphUtil.mergeSignatures((DefaultDynamicSignature) locSig, createRobotSignature());
}
File meanings:
mm_sig_loc.ecore
— the bi-spatial signature metamodel ("location-aware bigraph")sig_loc.xmi
— the bi-spatial signature instance
This bi-spatial signature defines a very abstract syntax layer for this cyber-physical application.
It consist of only Route
s and Locale
s.
These files were exported using the model-provider-core library of the Bigraph Toolkit Suite: https://github.com/bigraph-toolkit-suite/bigraphs.model-provider
They can also be created programmatically using:
BiSpaceSignatureProvider.getInstance().getSignature();