Skip to content

Instantly share code, notes, and snippets.

@kenwebb
Last active July 19, 2023 03:02
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/00b9d3fa30ab85a2109a1ceb0dd0f40c to your computer and use it in GitHub Desktop.
Save kenwebb/00b9d3fa30ab85a2109a1ceb0dd0f40c to your computer and use it in GitHub Desktop.
Binary Trees - experiments
<?xml version="1.0" encoding="UTF-8"?>
<!--Xholon Workbook http://www.primordion.com/Xholon/gwt/ MIT License, Copyright (C) Ken Webb, Tue Jul 18 2023 23:02:29 GMT-0400 (GMT-04:00)-->
<XholonWorkbook>
<Notes><![CDATA[
Xholon
------
Title: Binary Trees - experiments
Description:
Url: http://www.primordion.com/Xholon/gwt/
InternalName: 00b9d3fa30ab85a2109a1ceb0dd0f40c
Keywords:
My Notes
--------
17 July 2023
Generate complete Binary Trees.
]]></Notes>
<_-.XholonClass>
<PhysicalSystem/>
<Node/>
</_-.XholonClass>
<xholonClassDetails>
<!--<Block>
<port name="height" connector="Height"/>
</Block>-->
</xholonClassDetails>
<PhysicalSystem>
<!-- one -->
<Node/>
<!-- two -->
<Node>
<Node/>
<Node/>
</Node>
<!-- three -->
<Node>
<Node>
<Node/>
<Node/>
</Node>
<Node>
<Node/>
<Node/>
</Node>
</Node>
<!-- four -->
<Node>
<Node>
<Node>
<Node/>
<Node/>
</Node>
<Node>
<Node/>
<Node/>
</Node>
</Node>
<Node>
<Node>
<Node/>
<Node/>
</Node>
<Node>
<Node/>
<Node/>
</Node>
</Node>
</Node>
<!-- five -->
<Node>
<Node>
<Node/>
<Node/>
</Node>
<Node>
<Node/>
<Node/>
</Node>
</Node>
<Node>
<Node>
<Node/>
<Node/>
</Node>
<Node>
<Node/>
<Node/>
</Node>
</Node>
</PhysicalSystem>
<PhysicalSystembehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[
var me, externals, beh = {
postConfigure: function() {
me = this.cnode.parent();
externals = [];
$wnd.xh.root().append(this.cnode.remove());
me.visit(this.cnode);
me.println(externals.join(","));
// node_49,node_53,node_56,node_61,node_64,node_68,node_71,node_75,node_78,node_82,node_85
},
act: function() {
me.println("ACT " + me.name() + " " + count);
},
visit: function(visitor) {
me.println(visitor.name());
if (!visitor.first() && !visitor.next()) {
externals.push(visitor.name());
}
return true;
}
}
//# sourceURL=PhysicalSystembehavior.js
]]></PhysicalSystembehavior>
<SvgClient><Attribute_String roleName="svgUri"><![CDATA[data:image/svg+xml,
<svg width="100" height="50" xmlns="http://www.w3.org/2000/svg">
<g>
<title>Node</title>
<rect id="PhysicalSystem/Node" fill="#98FB98" height="50" width="50" x="25" y="0"/>
<g>
<title>Height</title>
<rect id="PhysicalSystem/Node/Node" 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