Skip to content

Instantly share code, notes, and snippets.

@kenwebb
Last active July 22, 2017 21:27
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/25a385f2ed39c7912c1179a7a45ea868 to your computer and use it in GitHub Desktop.
Save kenwebb/25a385f2ed39c7912c1179a7a45ea868 to your computer and use it in GitHub Desktop.
little 2-cubes operad E2
<_-.Rectangle roleName="Ψ1">
<Rectangle roleName="1"/>
</_-.Rectangle>
<_-.Rectangle roleName="Ψ2">
<Rectangle roleName="2"/>
<Rectangle roleName="3"/>
</_-.Rectangle>
<_-.Rectangle roleName="Ψ3">
<Rectangle roleName="4"/>
<Rectangle roleName="5"/>
</_-.Rectangle>
<_-.Rectangle roleName="Ψ4">
<Rectangle roleName="6"/>
<Rectangle roleName="7"/>
</_-.Rectangle>
<?xml version="1.0" encoding="UTF-8"?>
<!--Xholon Workbook http://www.primordion.com/Xholon/gwt/ MIT License, Copyright (C) Ken Webb, Sat Jul 22 2017 17:26:27 GMT-0400 (EDT)-->
<XholonWorkbook>
<Notes><![CDATA[
Xholon
------
Title: little 2-cubes operad E2
Description:
Url: http://www.primordion.com/Xholon/gwt/
InternalName: 25a385f2ed39c7912c1179a7a45ea868
Keywords:
My Notes
--------
July 18, 2017
Building block Ψ1 (select node "1" in the larger rectangle, and do Edit > Paste Replacement):
<Rectangle roleName="Ψ1">
<Rectangle roleName="1"/>
</Rectangle>
But, I want rectangle Ψ1 to be flattened during the operation.
- making it a forest makes the whole operation fail silently
It should be:
<_-.Rectangle roleName="Ψ1">
<Rectangle roleName="1"/>
</_-.Rectangle>
This works:
<Rectangle roleName="1"/>
July 19, 2017
version 2
---------
The only way I can currently do this in Xholon, is with xi:include, which is the Xholon way of doing file inclusion.
The included file has to be a FOREST, when there are more than one top-level nodes.
But psi1.xml could be just (but best to make it part of a FOREST)):
<Rectangle roleName="1"/>
version 1
---------
Using my fixed version of pasteReplacement() in CutCopyPaste.java (Edit > Paste Replacement (from clipboard)):
paste into original rectangle 1:
<_-.Rectangle roleName="Ψ1" operation="replace">
<Rectangle roleName="101"/>
</_-.Rectangle>
paste into original rectangle 2:
<_-.Rectangle roleName="Ψ2" operation="replace">
<Rectangle roleName="201"/>
<Rectangle roleName="202"/>
</_-.Rectangle>
paste into original rectangle 3:
<_-.Rectangle roleName="Ψ3" operation="replace">
<Rectangle roleName="301"/>
<Rectangle roleName="302"/>
</_-.Rectangle>
paste into original rectangle 4:
<_-.Rectangle roleName="Ψ4" operation="replace">
<Rectangle roleName="401"/>
<Rectangle roleName="402"/>
</_-.Rectangle>
References
----------
(1) http://math.mit.edu/~dspivak/informatics/Matriarch_ACS_BMSE.PDF
Figure 2. Architecture of rectangle arrangements. Equivalent to an early
example of an operad from mathematics called the little 2-cubes operad
E2. In the terminology of this paper, the only building blocks in E2 are
rectangles. A building instruction in E2 is an arrangement of nonoverlapping
rectangles within a larger rectangle. In the composition, the placements and
aspect ratios of building blocks are retained, but sizes can change. The
operad E2 is the mathematical description of rectangle configurations as
they are nested into hierarchies of arbitrary depth. The operad underlying
Matriarch is far more complex than E2, with more diverse building blocks
and building instructions.
]]></Notes>
<_-.XholonClass>
<PhysicalSystem/>
<Rectangle/>
</_-.XholonClass>
<xholonClassDetails>
</xholonClassDetails>
<PhysicalSystem xmlns:xi="http://www.w3.org/2001/XInclude">
<!-- this is the original larger rectangle -->
<Rectangle roleName="Ψ version 1">
<Rectangle roleName="1"/>
<Rectangle roleName="2"/>
<Rectangle roleName="3"/>
<Rectangle roleName="4"/>
</Rectangle>
<Rectangle roleName="Ψ version 2">
<xi:include href="https://gist.github.com/kenwebb/25a385f2ed39c7912c1179a7a45ea868/raw/psi1.xml"/>
<xi:include href="https://gist.github.com/kenwebb/25a385f2ed39c7912c1179a7a45ea868/raw/psi2.xml"/>
<xi:include href="https://gist.github.com/kenwebb/25a385f2ed39c7912c1179a7a45ea868/raw/psi3.xml"/>
<xi:include href="https://gist.github.com/kenwebb/25a385f2ed39c7912c1179a7a45ea868/raw/psi4.xml"/>
</Rectangle>
</PhysicalSystem>
<SvgClient><Attribute_String roleName="svgUri"><![CDATA[data:image/svg+xml,
<svg width="100" height="50" xmlns="http://www.w3.org/2000/svg">
<g>
<title>Rectangle</title>
<rect id="PhysicalSystem/Rectangle" fill="#98FB98" height="50" width="50" x="25" y="0"/>
<g>
<title>sub Rectangle</title>
<rect id="PhysicalSystem/Rectangle[2]" 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