Skip to content

Instantly share code, notes, and snippets.

@kenwebb
Last active July 3, 2018 10:40
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/cfeffb5477c2be260bdc5d0310d25c3d to your computer and use it in GitHub Desktop.
Save kenwebb/cfeffb5477c2be260bdc5d0310d25c3d to your computer and use it in GitHub Desktop.
Behavior Arrays
<?xml version="1.0" encoding="UTF-8"?>
<!--Xholon Workbook http://www.primordion.com/Xholon/gwt/ MIT License, Copyright (C) Ken Webb, Tue Jul 03 2018 06:39:52 GMT-0400 (Eastern Daylight Time)-->
<XholonWorkbook>
<Notes><![CDATA[
Xholon
------
Title: Behavior Arrays
Description:
Url: http://www.primordion.com/Xholon/gwt/
InternalName: cfeffb5477c2be260bdc5d0310d25c3d
Keywords:
My Notes
--------
July 2, 2018
Test the new ActRunner.java class.
It stores IXholon nodes in an internal JavaScript array.
These nodes are not part of the Xholon CompositeStructureHierarchy (CSH) tree.
ActRunner invokes the act() method on each node at each time step.
The IXholon nodes stored in ActRunner:
actRunner.obj();
The IXholon nodes stored in ActRunner, can be viewed as remote nodes referenced from a port (PortInformation) array:
actRunner.links(false, true);
The system Avatar can readily move to the ActRunner node, and from there it can move to one of the first ten behavior nodes using the keyboard keys "0" to "9".
If it stays inside ActRunner fro a timestep, then ActRunner will add it to its internal array.
It's like going inside a black hole.
In this model:
- all of the structure is inside the Block node
- all of the behavior is inside the ActRunner node
]]></Notes>
<_-.XholonClass>
<PhysicalSystem/>
<Block/>
<Brick/>
</_-.XholonClass>
<xholonClassDetails>
</xholonClassDetails>
<PhysicalSystem>
<Block>
<Brick multiplicity="100"/>
</Block>
<ActRunner/>
</PhysicalSystem>
<Brickbehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[
$wnd.xh.Brickbehavior = function Brickbehavior() {}
$wnd.xh.Brickbehavior.prototype.postConfigure = function() {
this.brick = this.cnode.parent();
this.iam = " red brick";
// add this behavior to the ActRunner
this.brick.parent().next().append(this.cnode.remove());
};
$wnd.xh.Brickbehavior.prototype.act = function() {
this.brick.println(this.brick.name() + " is a" + this.iam);
};
//# sourceURL=Brickbehavior.js
]]></Brickbehavior>
<SvgClient><Attribute_String roleName="svgUri"><![CDATA[data:image/svg+xml,
<svg width="100" height="50" xmlns="http://www.w3.org/2000/svg">
<g>
<title>Block</title>
<rect id="PhysicalSystem/Block" fill="#98FB98" height="50" width="50" x="25" y="0"/>
<g>
<title>Brick</title>
<rect id="PhysicalSystem/Block/Brick" 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