Skip to content

Instantly share code, notes, and snippets.

@kenwebb
Last active September 7, 2017 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenwebb/6c6ae27707a20599fcb7bdda4eb51eac to your computer and use it in GitHub Desktop.
Save kenwebb/6c6ae27707a20599fcb7bdda4eb51eac to your computer and use it in GitHub Desktop.
Bigraphs 2017 01
<?xml version="1.0" encoding="UTF-8"?>
<!--Xholon Workbook http://www.primordion.com/Xholon/gwt/ MIT License, Copyright (C) Ken Webb, Thu Sep 07 2017 11:34:32 GMT-0400 (EDT)-->
<XholonWorkbook>
<Notes><![CDATA[
Xholon
------
Title: Bigraphs 2017 01
Description:
Url: http://www.primordion.com/Xholon/gwt/
InternalName: 6c6ae27707a20599fcb7bdda4eb51eac
Keywords:
My Notes
--------
September 7 2017
Learning bigraphs
Example from slide 4+
References
----------
() Robin Milner, "Bigraphs: a model for mobile agents", slides, Nov 2008
() Robin Milner, "Bigraphs: a model for mobile agents", lecture notes, Nov 2008
]]></Notes>
<_-.XholonClass>
<PhysicalSystem/>
<Node/>
<Hyperedge/>
</_-.XholonClass>
<xholonClassDetails>
<Avatar><Color>rgba(255,215,0,0.8)</Color></Avatar>
<Hyperedge xhType="XhtypePureActiveObject"/>
</xholonClassDetails>
<PhysicalSystem>
<Bigraphs>
<Bigraph roleName="bare bigraph G (slide 4)">
<PlaceGraph> <!-- a forest, the bigraph's placing, the node-nesting -->
<Node roleName="v0">
<Node roleName="v1"/>
<Node roleName="v2">
<Node roleName="v3"/>
</Node>
</Node>
<Node roleName="v4">
<Node roleName="v5"/>
</Node>
</PlaceGraph>
<LinkGraph> <!-- a hypergraph, the bigraph's linking, the edges -->
<Hyperedge roleName="e0" nodenames="v0,v1,v4"/>
<Hyperedge roleName="e1" nodenames="v1,v3"/>
<Hyperedge roleName="e2" nodenames="v3,v4,v5"/>
</LinkGraph>
</Bigraph>
</Bigraphs>
</PhysicalSystem>
<LinkGraphbehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[
var me, beh = {
postConfigure: function() {
me = this.cnode.parent();
var pg = me.xpath("../PlaceGraph");
var he = me.first();
$wnd.console.log(he.name());
while (he) {
var nnamesCsv = he.nodenames;
$wnd.console.log(nnamesCsv);
if (nnamesCsv) {
var nnames = nnamesCsv.split(",");
if (nnames) {
for (var i = 0; i < nnames.length; i++) {
var nname = nnames[i];
var node = pg.xpath("descendant::Node[@roleName='" + nname + "']");
$wnd.console.log(" " + node.name());
he.port(i, node);
}
}
}
he = he.next();
}
this.cnode.remove();
}
}
]]></LinkGraphbehavior>
<SvgClient><Attribute_String roleName="svgUri"><![CDATA[data:image/svg+xml,
<svg width="100" height="50" xmlns="http://www.w3.org/2000/svg">
<g>
<title>Bigraphs</title>
<rect id="PhysicalSystem/Bigraphs" fill="#98FB98" height="50" width="50" x="25" y="0"/>
<g>
<title>Bigraph</title>
<rect id="PhysicalSystem/Bigraphs/Bigraph" fill="#6AB06A" height="50" width="10" x="80" y="0"/>
</g>
</g>
</svg>
]]></Attribute_String><Attribute_String roleName="setup">${MODELNAME_DEFAULT},${SVGURI_DEFAULT}</Attribute_String></SvgClient>
</XholonWorkbook>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment