Skip to content

Instantly share code, notes, and snippets.

@kenwebb
Last active December 18, 2017 13:23
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/dcc6eca037a3c0073ebe55eb8ffeba68 to your computer and use it in GitHub Desktop.
Save kenwebb/dcc6eca037a3c0073ebe55eb8ffeba68 to your computer and use it in GitHub Desktop.
Cell Model - Sets
<?xml version="1.0" encoding="UTF-8"?>
<!--Xholon Workbook http://www.primordion.com/Xholon/gwt/ MIT License, Copyright (C) Ken Webb, Mon Dec 18 2017 08:23:05 GMT-0500 (EST)-->
<XholonWorkbook>
<Notes><![CDATA[
Xholon
------
Title: Cell Model - Sets
Description:
Url: http://www.primordion.com/Xholon/gwt/
InternalName: dcc6eca037a3c0073ebe55eb8ffeba68
Keywords:
My Notes
--------
December 13, 2017
Describe my Cell Model using Sets.
I should be able to write a Xholon exporter that writes to this format.
I may want to have a new Xholon Mechanism that will help with this.
One goal with this workbook is to view a d3cp visualization of the result. Each set will be a spiral.
Then I want to figure out how to view each set as a vertical line of dots or circles.
Can I describe this model as having multiple bipartite graphs/relations?
- each instance of Pairs specifies a bipartite graph that could stand on its own
See my written notebook: Dec 11
I can think of this as a canonic way to represent things in Xholon and Xholon apps.
isomorphism vs homomorphism vs homeomorphism
--------------------------------------------
https://math.stackexchange.com/questions/585787/whats-the-difference-between-isomorphism-and-homeomorphism#585801
automorphism
------------
https://en.wikipedia.org/wiki/Automorphism
- "In mathematics, an automorphism is an isomorphism from a mathematical object to itself."
- this is the term I'm really after
- "In category theory, an automorphism is an endomorphism (i.e., a morphism from an object to itself) which is also an isomorphism (in the categorical sense of the word)."
- "The identity morphism (identity mapping) is called the trivial automorphism in some contexts. Respectively, other (non-identity) automorphisms are called nontrivial automorphisms."
- see "Examples"
TODO
----
- write a behavior that creates XhEle nodes for all sets, and that creates ports based on the XhSet ports and the Pairs
- how to represent edges/ports (Pairs) between sets A and B where A = B ?
- for example: parent,first,next are functions from NodeXS to NodeXS
- for example: parent is a function from XholonClassXS to XholonClassXSXholonClassXS
- OR instead of using parent, use the Operad approach where elements from the power set map to elements of the set
- how do I decide between these approaches?
- HTML uses both: parent,first,next AND children/childNodes
- how to represent homo/isomorphisms? f: A -> A
- such as parent/first/next parent: A -> A
- should I have multiple instances of the same NodesXS set?
- I would like the graphs to be Directed Acyclic Graphs (DAG)s, where arrows always move to the right
- f: A -> A is cyclic
- I could have: <NodeXS multiplicity="4"/>
- OR
<NodeXS roleName="identity"/>
<NodeXS roleName="first"/>
<NodeXS roleName="next"/>
<NodeXS roleName="parent"/>
<NodeXS roleName="ports"/>
- does the literature contain rules on how to construct a system of sets that can work together, including working together as a Category?
- search: systems of sets (nothing useful after 50 hits)
- ref[3] is probably not relevant
- see the Music category I found, which is a good example of a system of sets
- http://www.primordion.com/Xholon/gwt/wb/editwb.html?app=e3c83fa74f2b0e59924ebea485506277&src=gist
- https://www.youtube.com/watch?v=4fggq5U3Khg
Category Theory: The Beginner’s Introduction (Lesson 1 Video 2)
by Dr. Martin J.M. Codrington
Note that:
for all nodeA in set A: identity(nodeA) == nodeA
for all nodeA in set A: first(nodeA) != nodeA
for all nodeA in set A: next(nodeA) != nodeA
for all nodeA in set A: parent(nodeA) != nodeA
for all nodeA in set A: somePortOf(nodeA) MAY== nodeA
Some graphs have Bipartite edge/port structures:
- for example: Petri Nets have Transitions and Places
- a Transition will never reference another Transition
- a Place will never reference another Place
- all ports are from a Transition to a Place
- in these systems, there should be a separate set for each type
- with Petri Nets, Places should be further to the right than Transitions
December 14
- possibly I need to allow feedback?/backwards arrows between elements in the same set
- so elements in NodeXS can have first/next/parent/port references to other elements in NodeXS
- the main problem is the large number of arrows which is confusing
- if the trees are created in pre-order? sequence, is there a consistent ordering between node and node.first, and node and node.next, and node and node.parent?
- but even if this is consistent, it may change over time
- pre-order, in-order, post-order
- I could maintain a forward-arrow convention in diagrams, if children and siblings are properly ordered
- in a diagram, I could draw the NodeXE elements inside NodeXS as an indented structure so first and next arrows would always point to the right
- as an option, the arrows for identity/first/next could be left out
- parent is also clear in an indented structure
- in a visualization, port is the only problem
- I may need multiplicity of NodeXS to maintain arrows always pointing right
- see Squeak and Morphic
// /home/ken/gwtspace/Xholon/Xholon/script/javascript/writeSetOfAttrs.js
/*
* Script to write out a set of attributes from a Xholon app.
* for use with:
* http://127.0.0.1:8888/wb/editwb.html?app=Cell+Model+-+Sets&src=lstr
* https://gist.github.com/kenwebb/dcc6eca037a3c0073ebe55eb8ffeba68
*/
(function(root, attrName) {
var writeAttrs = function(node, attrName) {
writeAttr(node, attrName);
var childNode = node.first();
while (childNode) {
writeAttrs(childNode, attrName);
childNode = childNode.next();
}
}
var writeAttr = function(node, attrName) {
if (node != root) {
eleStr += ",";
}
switch (attrName) {
case "NodeXE":
eleStr += node.id();
break;
case "RoleNameXE":
eleStr += node.role();
break;
case "ValXE":
eleStr += node.val();
break;
case "XholonClassXE":
// TODO ignore duplicates
eleStr += node.xhc().id();
break;
case "XholonClassNameXE":
// TODO ignore duplicates
eleStr += node.xhc().name();
break;
default: break;
}
}
//var root = xh.root();
var eleStr = "{";
writeAttrs(root, attrName);
eleStr += "}";
root.println(eleStr);
})(xh.root(), "NodeXE")
Graphviz:
--------
To repeat this Xholon export:
xh.xport("Graphviz", xh.root().parent().xpath("Chameleon/PhysicalSystem/XhModel[@roleName='Cell Model']"), '{"gvFileExt":".gv","gvGraph":"digraph","layout":"dot","edgeOp":"->","gvCluster":"cluster","shouldShowStateMachineEntities":false,"filter":"--Behavior,Script","nameTemplateNodeId":"^^^^i^","nameTemplateNodeLabel":"R^^^^^","shouldQuoteLabels":true,"shouldShowLinks":true,"shouldShowLinkLabels":false,"shouldSpecifyLayout":false,"maxLabelLen":-1,"shouldColor":true,"defaultNodeColor":"#f0f8ff","bgGraphColor":"white","shouldSpecifyShape":true,"shape":"box","shouldSpecifySize":true,"size":"33","shouldSpecifyFontname":true,"fontname":"Courier","shouldSpecifyArrowhead":true,"arrowhead":"vee","shouldSpecifyStylesheet":true,"stylesheet":"Xholon.css","shouldSpecifyRankdir":true,"rankdir":"LR","shouldDisplayGraph":true,"outputFormat":"svg"}');
December 15
- How do I map NodeXE elements to ValXE elements?
- the values can be long real numbers
- recall that in a relational database, these two values would probably belong to the same database table
- so treat NodeXS as a table column, where there's a one-to-one relationship between elements in NodeXS and ValXS
- instead of enumerating all the pairs in <Pairs/>, use an XML attribute to specify that there's a column-relationship
- as a visualization, I would want to align ValXS/ValXE immwediately to the right of NodeXS/NodeXE, with or without arrows
- allow other specification options:
- both of A and B could be:
- "roleName" (default) - the entry in the ordered pair (2-tuple) is a roleName
- "index" - the entry is an XPath (1-based) index (ex: "5" means "ValXS/ValXE[5]")
- "column" - as described above; or use the word "join" because it involves joining 2 sets as in relational algebra
- database table rows are called tuples (ref[9])
- so some of what I'm doing in this workbook, is much the same as a relational database; the idea that some sets can be thought of as columns in a single database table
References
----------
(1) https://en.wikipedia.org/wiki/Directed_acyclic_graph
"In mathematics and computer science, a directed acyclic graph (DAG /ˈdæɡ/ (About this sound listen)), is a finite directed graph with no directed cycles. That is, it consists of finitely many vertices and edges, with each edge directed from one vertex to another, such that there is no way to start at any vertex v and follow a consistently-directed sequence of edges that eventually loops back to v again. Equivalently, a DAG is a directed graph that has a topological ordering, a sequence of the vertices such that every edge is directed from earlier to later in the sequence."
"A vertex v of a directed graph is said to be reachable from another vertex u when there exists a path that starts at u and ends at v. As a special case, every vertex is considered to be reachable from itself (by a path with zero edges). If a vertex can reach itself via a nontrivial path (a path with one or more edges), then that path is a cycle, so another way to define directed acyclic graphs is that they are the graphs in which no vertex can reach itself via a nontrivial path."
(2) https://en.wikipedia.org/wiki/Cycle_graph
parent/first/next are cycle graphs Cn where n = 0
ports may or may not be part of a cycle graph, and seldom point to themselves
"In graph theory, a cycle graph or circular graph is a graph that consists of a single cycle, or in other words, some number of vertices connected in a closed chain. The cycle graph with n vertices is called Cn. The number of vertices in Cn equals the number of edges, and every vertex has degree 2; that is, every vertex has exactly two edges incident with it."
(3) https://en.wikipedia.org/wiki/Family_of_sets
In set theory and related branches of mathematics, a collection F of subsets of a given set S is called a family of subsets of S, or a family of sets over S. More generally, a collection of any sets whatsoever is called a family of sets.
The term "collection" is used here because, in some contexts, a family of sets may be allowed to contain repeated copies of any given member,[1][2][3] and in other contexts it may form a proper class rather than a set.
(4) https://en.m.wikibooks.org/wiki/Set_Theory
(5) http://mfleck.cs.illinois.edu/building-blocks/
Building Blocks for Theoretical Computer Science
Margaret M. Fleck
(6) https://en.wikipedia.org/wiki/Squeak
(7) https://en.wikipedia.org/wiki/Morphic_(software)
) https://github.com/jmoenig/morphic.js
) https://en.wikipedia.org/wiki/Direct_manipulation_interface
) https://en.wikipedia.org/wiki/Open_Cobalt
Open Cobalt is a free and open-source software platform for constructing, accessing, and sharing virtual worlds both on local area networks or across the Internet, without any requirement for centralized servers.
(8) https://en.wikipedia.org/wiki/Ordered_pair
In mathematics, an ordered pair (a, b) is a pair of objects. The order in which the objects appear in the pair is significant: the ordered pair (a, b) is different from the ordered pair (b, a) unless a = b. (In contrast, the unordered pair {a, b} equals the unordered pair {b, a}.)
Ordered pairs are also called 2-tuples, or sequences (sometimes, lists in a computer science context) of length 2; ordered pairs of scalars are also called 2-dimensional vectors. The entries of an ordered pair can be other ordered pairs, enabling the recursive definition of ordered n-tuples (ordered lists of n objects). For example, the ordered triple (a,b,c) can be defined as (a, (b,c)), i.e., as one pair nested in another.
In the ordered pair (a, b), the object a is called the first entry, and the object b the second entry of the pair. Alternatively, the objects are called the first and second components, the first and second coordinates, or the left and right projections of the ordered pair.
(9) https://en.wikipedia.org/wiki/Tuple
In mathematics a tuple is a finite ordered list (sequence) of elements.
An n-tuple is a sequence (or ordered list) of n elements, where n is a non-negative integer.
There is only one 0-tuple, an empty sequence. An n-tuple is defined inductively using the construction of an ordered pair.
Mathematicians usually write tuples by listing the elements within parentheses " {\displaystyle ({\text{ }})} (\text{ })"
and separated by commas; for example, {\displaystyle (2,7,4,1,7)} (2, 7, 4, 1, 7) denotes a 5-tuple.
Relational databases may formally identify their rows (records) as tuples.
(10) https://en.wikipedia.org/wiki/Hierarchical_database_model
(11) http://troels.arvin.dk/db/rdbms/links/#hierarchical
(12) http://www.dcs.warwick.ac.uk/~hugh/
Hugh Darwen materials on relational algebra and Rel
(13) http://spots.gru.edu/tschultz/resources/eBooks/RelationalDBTheoryIntro.pdf
An Introduction to Relational Database Theory, Hugh Darwen
(14) http://www.thethirdmanifesto.com/
The Third Manifesto
(15) https://reldb.org/c/
Rel is a free, open-source, true relational database management system with an advanced query language called Tutorial D.
What's it for?
Rel is ideal for managing personal databases.
Rel is great for exploring Tutorial D, the language used in popular database texts like C J Date's "An Introduction to Database Systems".
(16) https://en.wikipedia.org/wiki/Relational_algebra
Relational algebra, first created by Edgar F. Codd while at IBM, is a family of algebras with a well-founded semantics used for modelling the data stored in relational databases, and defining queries on it.
The main application of relational algebra is providing a theoretical foundation for relational databases, particularly query languages for such databases, chief among which is SQL.
Relational algebra received little attention outside of pure mathematics until the publication of E.F. Codd's relational model of data in 1970. Codd proposed such an algebra as a basis for database query languages.
Five primitive operators of Codd's algebra are the selection, the projection, the Cartesian product (also called the cross product or cross join), the set union, and the set difference.
]]></Notes>
<params>
<param name="MaxPorts" value="6"/>
</params>
<_-.XholonClass>
<PhysicalSystem/>
<XhModel/>
<!-- sets -->
<XhSet>
<NodeXS/>
<RoleNameXS/>
<ValXS/>
<TextXS/>
<AnnoXS/>
<XholonClassXS/>
<XholonClassNameXS/>
<XhTypeXS/>
<JavaClassXS/>
<MechXS/>
<!-- optional IDecoration sets: DecColor DecOpacity DecFont DecIcon DecToolTp DecSymbol DecFormat DecGeo DecSound -->
<DecColorXS/>
</XhSet>
<!-- elements -->
<XhEle>
<NodeXE/>
<RoleNameXE/>
<ValXE/>
<TextXE/>
<AnnoXE/>
<XholonClassXE/>
<XholonClassNameXE/>
<XhTypeXE/>
<JavaClassXE/>
<MechXE/>
<!-- optional IDecoration -->
<DecColorXE/>
</XhEle>
<Pairs/>
</_-.XholonClass>
<xholonClassDetails>
<!-- all of these ports are functions -->
<NodeXS xhType="XhtypePureActiveObject">
<port name="port" index="0" connector="../XholonClassXS"/>
<port name="port" index="1" connector="../RoleNameXS"/>
<port name="port" index="2" connector="../ValXS"/> <!-- only the PO nodes have meaningful values; although it could be meaningful for AO -->
<port name="port" index="3" connector="../NodeXS"/> <!-- CSH component hierarchy -->
<!-- bipartite ports from AO to PO; an AO NodeXE may have 0..n such ports -->
<port name="port" index="4" connector="../NodeXS"/>
<port name="port" index="5" connector="../NodeXS"/>
<port name="port" index="6" connector="../NodeXS"/>
</NodeXS>
<XholonClassXS xhType="XhtypePureActiveObject">
<port name="port" index="0" connector="../XholonClassNameXS"/>
<port name="port" index="1" connector="../XhTypeXS"/>
<port name="port" index="2" connector="../XholonClassXS"/> <!-- IH component hierarchy -->
</XholonClassXS>
<NodeXE xhType="XhtypePureActiveObject"/>
<RoleNameXE xhType="XhtypePureActiveObject"/>
<ValXE xhType="XhtypePureActiveObject"/>
<TextXE xhType="XhtypePureActiveObject"/>
<AnnoXE xhType="XhtypePureActiveObject"/>
<XholonClassXE xhType="XhtypePureActiveObject"/>
<XholonClassNameXE xhType="XhtypePureActiveObject"/>
<XhTypeXE xhType="XhtypePureActiveObject"/>
<JavaClassXE xhType="XhtypePureActiveObject"/>
<MechXE xhType="XhtypePureActiveObject"/>
<DecColorXE xhType="XhtypePureActiveObject"/>
<!-- reusing the colors from my Cube model -->
<XhSet><Color>#c2e189</Color></XhSet>
<NodeXE><Color>#b8ccea</Color></NodeXE>
<ValXE><Color>#d0c883</Color></ValXE>
<XholonClassXE><Color>#171c8f</Color></XholonClassXE>
<XholonClassNameXE><Color>#f1b434</Color></XholonClassNameXE>
<XhTypeXE><Color>#9cdbd9</Color></XhTypeXE>
</xholonClassDetails>
<PhysicalSystem>
<XhModel roleName="Testing">
<!-- Sets, CT Objects -->
<!-- identity; node IDs -->
<NodeXS delimiter=","><Attribute_String>{0,1,2,3}</Attribute_String>
<!-- example of a NodeXE -->
<NodeXE roleName="test">
<port name="port" index="0" connector="../../XholonClassXS/XholonClassXE[@roleName='test']"/>
</NodeXE>
</NodeXS>
<RoleNameXS delimiter=","><Attribute_String>{}</Attribute_String></RoleNameXS> <!-- there are no rolenames in the Cell Model -->
<ValXS delimiter=","><Attribute_String>{1003.4,2006.543,1234.0}</Attribute_String></ValXS>
<XholonClassXS delimiter=","><Attribute_String>{1,2,3,4,5,6,7,8,9,10}</Attribute_String>
<!-- example of a XholonClassXE -->
<XholonClassXE roleName="test">
<!--<port name="port" index="0" connector="../../XholonClassXS/XholonClassXE[@roleName='1']"/>-->
</XholonClassXE>
</XholonClassXS>
<XholonClassNameXS delimiter=","><Attribute_String>{One,Two,Three,Four,Five,Six,Seven,Eight,Nine,Ten}</Attribute_String></XholonClassNameXS>
<!-- system sets -->
<!-- XhTypeXS set has numeric {0,1,2,3,4,5,6,7} and String values; the following can be thought of as numeric constants or as Strings -->
<XhTypeXS delimiter=","><Attribute_String>{Xhtypexxxxxxxxx, XhtypePureContainer, XhtypePurePassiveObject, XhtypexxxFgsCon, XhtypePureActiveObject, XhtypeBehxxxCon, XhtypeBehFgsxxx, XhtypeBehFgsCon}</Attribute_String></XhTypeXS>
<!--
A function from the set NodeXS to the set XholonClassXS.
Arrows, CT Morphisms, edges, ordered pairs
instances of function xhc from NodeXS to XholonClassXS
using Set Theory Notation {{a, b} : a ∈ NodeXS, b ∈ XholonClassXS}
a set of ordered pairs {(a, b) | a ∈ NodeXS, b ∈ port0(NodeXS) = XholonClassXS}
a subset of A × B
TODO should each ordered pair be inside () or {} ? see ref[8] - should be ()
-->
<Pairs from="NodeXS.0"><Attribute_String>{
(0,1)
(1,2)
}</Attribute_String></Pairs>
</XhModel>
<XhModel roleName="Template">
<NodeXS delimiter=","><Attribute_String>{}</Attribute_String></NodeXS>
<RoleNameXS delimiter=","><Attribute_String>{}</Attribute_String></RoleNameXS>
<ValXS delimiter=","><Attribute_String>{}</Attribute_String></ValXS>
<XholonClassXS delimiter=","><Attribute_String>{}</Attribute_String></XholonClassXS>
<XholonClassNameXS delimiter=","><Attribute_String>{}</Attribute_String></XholonClassNameXS>
<XhTypeXS delimiter=","><Attribute_String>{Xhtypexxxxxxxxx, XhtypePureContainer, XhtypePurePassiveObject, XhtypexxxFgsCon, XhtypePureActiveObject, XhtypeBehxxxCon, XhtypeBehFgsxxx, XhtypeBehFgsCon}</Attribute_String></XhTypeXS>
</XhModel>
<XhModel roleName="Cell Model">
<NodeXS delimiter=","><Attribute_String>{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28}</Attribute_String></NodeXS>
<RoleNameXS delimiter=","><Attribute_String>{}</Attribute_String></RoleNameXS>
<ValXS delimiter=","><Attribute_String>{1.7976931348623157e+308,1.7976931348623157e+308,100000,1.7976931348623157e+308,1.7976931348623157e+308,1.7976931348623157e+308,1.7976931348623157e+308,1.7976931348623157e+308,51009.046417748184,144372.47394189303,86557.89410804509,86454.9265126771,2046.7189671743902,122313.54521161264,102333.91436162658,26254.358373823332,239562.20171948127,89324.37425501985,181376.2051505348,1,1,1,1,1,1,1,1,1,1}</Attribute_String></ValXS>
<XholonClassXS delimiter=","><Attribute_String>{219,133,82,42,64,50,208,130,104,101,99,98,105,111,113,112,108,93,10,11,12,13,14,15,16,17,18,19,0,9,48,62,81,129,205,206}</Attribute_String></XholonClassXS>
<XholonClassNameXS delimiter=","><Attribute_String>{ExtraCellularSpace,ExtraCellularSolution,Glucose,EukaryoticCell,CellMembrane,CellBilayer,Cytoplasm,Cytosol,Glucose_6_Phosphate,Fructose_6_Phosphate,Fructose_1x6_Biphosphate,DihydroxyacetonePhosphate,Glyceraldehyde_3_Phosphate,X1x3_BisphosphoGlycerate,X3_PhosphoGlycerate,X2_PhosphoGlycerate,PhosphoEnolPyruvate,Pyruvate,Hexokinase,PhosphoGlucoIsomerase,PhosphoFructokinase,Aldolase,TriosePhosphateIsomerase,Glyceraldehyde_3_phosphateDehydrogenase,PhosphoGlycerokinase,PhosphoGlyceromutase,Enolase,PyruvateKinase,XholonClass,GlycolysisEnzyme,LipidBilayer,Membrane,SmallMolecule,CellularSolution,EnclosedSpace,CellularSpace}</Attribute_String></XholonClassNameXS>
<XhTypeXS delimiter=","><Attribute_String>{Xhtypexxxxxxxxx, XhtypePureContainer, XhtypePurePassiveObject, XhtypexxxFgsCon, XhtypePureActiveObject, XhtypeBehxxxCon, XhtypeBehFgsxxx, XhtypeBehFgsCon}</Attribute_String></XhTypeXS>
<!-- <port name="port" index="0" connector="../XholonClassXS"/> -->
<Pairs from="NodeXS.0" enabled="true"><Attribute_String>{
(0,219)
(1,133)
(2,82)
(3,42)
(4,64)
(5,50)
(6,208)
(7,130)
(8,82)
(9,104)
(10,101)
(11,99)
(12,98)
(13,105)
(14,111)
(15,113)
(16,112)
(17,108)
(18,93)
(19,10)
(20,11)
(21,12)
(22,13)
(23,14)
(24,15)
(25,16)
(26,17)
(27,18)
(28,19)
}</Attribute_String></Pairs>
<!-- <port name="port" index="2" connector="../ValXS"/> -->
<Pairs from="NodeXS.2" column="true" enabled="true"></Pairs>
<!-- <port name="port" index="3" connector="../NodeXS"/> CSH component hierarchy child -> parent TODO add pairs between Containers -->
<Pairs from="NodeXS.3" enabled="true"><Attribute_String>{
(1,0)
(2,1)
(3,0)
(4,3)
(5,4)
(6,3)
(7,6)
(8,7)
(9,7)
(10,7)
(11,7)
(12,7)
(13,7)
(14,7)
(15,7)
(16,7)
(17,7)
(18,7)
(19,6)
(20,6)
(21,6)
(22,6)
(23,6)
(24,6)
(25,6)
(26,6)
(27,6)
(28,6)
}</Attribute_String></Pairs>
<!-- ports -->
<Pairs from="NodeXS.4" enabled="true"><Attribute_String>{
(5,2)
(5,8)
(19,8)
(19,9)
(20,9)
(20,10)
(21,10)
(21,11)
(22,11)
(22,13)
(22,12)
(23,12)
(23,13)
(24,13)
(24,14)
(25,14)
(25,15)
(26,15)
(26,16)
(27,16)
(27,17)
(28,17)
(28,18)
}</Attribute_String></Pairs>
<Pairs from="XholonClassXS.0" enabled="true"><Attribute_String>{
(219,ExtraCellularSpace)
(133,ExtraCellularSolution)
(82,Glucose)
(42,EukaryoticCell)
(64,CellMembrane)
(50,CellBilayer)
(208,Cytoplasm)
(130,Cytosol)
(104,Glucose_6_Phosphate)
(101,Fructose_6_Phosphate)
(99,Fructose_1x6_Biphosphate)
(98,DihydroxyacetonePhosphate)
(105,Glyceraldehyde_3_Phosphate)
(111,X1x3_BisphosphoGlycerate)
(113,X3_PhosphoGlycerate)
(112,X2_PhosphoGlycerate)
(108,PhosphoEnolPyruvate)
(93,Pyruvate)
(10,Hexokinase)
(11,PhosphoGlucoIsomerase)
(12,PhosphoFructokinase)
(13,Aldolase)
(14,TriosePhosphateIsomerase)
(15,Glyceraldehyde_3_phosphateDehydrogenase)
(16,PhosphoGlycerokinase)
(17,PhosphoGlyceromutase)
(18,Enolase)
(19,PyruvateKinase)
(0,XholonClass)
(9,GlycolysisEnzyme)
(48,LipidBilayer)
(62,Membrane)
(81,SmallMolecule)
(129,CellularSolution)
(205,EnclosedSpace)
(206,CellularSpace)
}</Attribute_String></Pairs>
<Pairs from="XholonClassXS.1" enabled="true"><Attribute_String>{
(219,XhtypePureContainer)
(133,XhtypePureContainer)
(82,XhtypePurePassiveObject)
(42,XhtypePureContainer)
(64,XhtypePureContainer)
(50,XhtypePureActiveObject)
(208,XhtypePureContainer)
(130,XhtypePureContainer)
(104,XhtypePurePassiveObject)
(101,XhtypePurePassiveObject)
(99,XhtypePurePassiveObject)
(98,XhtypePurePassiveObject)
(105,XhtypePurePassiveObject)
(111,XhtypePurePassiveObject)
(113,XhtypePurePassiveObject)
(112,XhtypePurePassiveObject)
(108,XhtypePurePassiveObject)
(93,XhtypePurePassiveObject)
(10,XhtypePureActiveObject)
(11,XhtypePureActiveObject)
(12,XhtypePureActiveObject)
(13,XhtypePureActiveObject)
(14,XhtypePureActiveObject)
(15,XhtypePureActiveObject)
(16,XhtypePureActiveObject)
(17,XhtypePureActiveObject)
(18,XhtypePureActiveObject)
(19,XhtypePureActiveObject)
}</Attribute_String></Pairs>
<!-- <port name="port" index="2" connector="../XholonClassXS"/> IH component hierarchy -->
<Pairs from="XholonClassXS.2" enabled="true"><Attribute_String>{
(219,205)
(133,129)
(82,81)
(42,0)
(64,62)
(50,48)
(208,206)
(130,129)
(82,81)
(104,81)
(101,81)
(99,81)
(98,81)
(105,81)
(111,81)
(113,81)
(112,81)
(108,81)
(93,81)
(10,9)
(11,9)
(12,9)
(13,9)
(14,9)
(15,9)
(16,9)
(17,9)
(18,9)
(19,9)
}</Attribute_String></Pairs>
</XhModel>
</PhysicalSystem>
<NodeXSbehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[
var me, beh = {
postConfigure: function() {
const eleNodeName = "NodeXE";
me = this.cnode.parent();
var attStrNode = me.first();
var elesStr = attStrNode.text();
if (elesStr) {
elesStr = elesStr.trim().substring(1, elesStr.length - 1); // remove surrounding whitespace and opening "{" and closing "}"
var elesArr = elesStr.split(me["delimiter"]);
if (elesArr) {
for (var i = 0; i < elesArr.length; i++) {
var eleRn = elesArr[i].trim();
me.append('<' + eleNodeName + ' roleName="' + eleRn + '">' + '</' + eleNodeName + '>');
}
}
}
attStrNode.remove();
this.cnode.remove();
}}
//# sourceURL=NodeXSbehavior.js
]]></NodeXSbehavior>
<RoleNameXSbehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[
var me, beh = {
postConfigure: function() {
const eleNodeName = "RoleNameXE";
me = this.cnode.parent();
var attStrNode = me.first();
var elesStr = attStrNode.text();
if (elesStr) {
elesStr = elesStr.trim().substring(1, elesStr.length - 1); // remove surrounding whitespace and opening "{" and closing "}"
var elesArr = elesStr.split(me["delimiter"]);
if (elesArr) {
for (var i = 0; i < elesArr.length; i++) {
var eleRn = elesArr[i].trim();
me.append('<' + eleNodeName + ' roleName="' + eleRn + '">' + '</' + eleNodeName + '>');
}
}
}
attStrNode.remove();
this.cnode.remove();
}}
//# sourceURL=RoleNameXSbehavior.js
]]></RoleNameXSbehavior>
<ValXSbehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[
var me, beh = {
postConfigure: function() {
const eleNodeName = "ValXE";
me = this.cnode.parent();
var attStrNode = me.first();
var elesStr = attStrNode.text();
if (elesStr) {
elesStr = elesStr.trim().substring(1, elesStr.length - 1); // remove surrounding whitespace and opening "{" and closing "}"
var elesArr = elesStr.split(me["delimiter"]);
if (elesArr) {
for (var i = 0; i < elesArr.length; i++) {
var eleRn = elesArr[i].trim();
me.append('<' + eleNodeName + ' roleName="' + eleRn + '">' + '</' + eleNodeName + '>');
}
}
}
attStrNode.remove();
this.cnode.remove();
}}
//# sourceURL=ValXSbehavior.js
]]></ValXSbehavior>
<XholonClassXSbehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[
var me, beh = {
postConfigure: function() {
const eleNodeName = "XholonClassXE";
me = this.cnode.parent();
var attStrNode = me.first();
var elesStr = attStrNode.text();
if (elesStr) {
elesStr = elesStr.trim().substring(1, elesStr.length - 1); // remove surrounding whitespace and opening "{" and closing "}"
var elesArr = elesStr.split(me["delimiter"]);
if (elesArr) {
for (var i = 0; i < elesArr.length; i++) {
var eleRn = elesArr[i].trim();
me.append('<' + eleNodeName + ' roleName="' + eleRn + '">' + '</' + eleNodeName + '>');
}
}
}
attStrNode.remove();
this.cnode.remove();
}}
//# sourceURL=XholonClassXSbehavior.js
]]></XholonClassXSbehavior>
<XholonClassNameXSbehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[
var me, beh = {
postConfigure: function() {
const eleNodeName = "XholonClassNameXE";
me = this.cnode.parent();
var attStrNode = me.first();
var elesStr = attStrNode.text();
if (elesStr) {
elesStr = elesStr.trim().substring(1, elesStr.length - 1); // remove surrounding whitespace and opening "{" and closing "}"
var elesArr = elesStr.split(me["delimiter"]);
if (elesArr) {
for (var i = 0; i < elesArr.length; i++) {
var eleRn = elesArr[i].trim();
me.append('<' + eleNodeName + ' roleName="' + eleRn + '">' + '</' + eleNodeName + '>');
}
}
}
attStrNode.remove();
this.cnode.remove();
}}
//# sourceURL=XholonClassNameXSbehavior.js
]]></XholonClassNameXSbehavior>
<XhTypeXSbehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[
var me, beh = {
postConfigure: function() {
const eleNodeName = "XhTypeXE";
me = this.cnode.parent();
var attStrNode = me.first();
var elesStr = attStrNode.text();
if (elesStr) {
elesStr = elesStr.trim().substring(1, elesStr.length - 1); // remove surrounding whitespace and opening "{" and closing "}"
var elesArr = elesStr.split(me["delimiter"]);
if (elesArr) {
for (var i = 0; i < elesArr.length; i++) {
var eleRn = elesArr[i].trim();
me.append('<' + eleNodeName + ' roleName="' + eleRn + '">' + '</' + eleNodeName + '>');
}
}
}
attStrNode.remove();
this.cnode.remove();
}}
//# sourceURL=XhTypeXSbehavior.js
]]></XhTypeXSbehavior>
<Pairsbehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[
var me, beh = {
postConfigure: function() {
/*
{
{0,1}
(1,2}
}
*/
const delimiterOuter ="\n";
const delimiterInner =",";
me = this.cnode.parent();
$wnd.console.log(me["enabled"]);
if (me["enabled"] == "true") {
$wnd.console.log("TRUE");
var fromNodePortStr = me.from; // the from Set and the from Set port ex: NodeXS.0
me.println(fromNodePortStr);
var fromNodePortArr = fromNodePortStr.trim().split(".");
var fromNodeStr = fromNodePortArr[0];
var fromPortStr = fromNodePortArr[1];
var fromNode = me.xpath("../" + fromNodeStr);
me.println(fromNode);
var toNode = fromNode.port(fromPortStr);
me.println(toNode);
var attStrNode = me.first();
if (attStrNode && (attStrNode != this.cnode)) {
var pairsStr = attStrNode.text();
if (pairsStr) {
pairsStr = pairsStr.trim().substring(1, pairsStr.length - 1).trim(); // remove surrounding whitespace and opening "{" and closing "}"
var pairsArr = pairsStr.split(delimiterOuter);
if (pairsArr) {
for (var i = 0; i < pairsArr.length; i++) {
var pairStr = pairsArr[i].trim();
me.println(pairStr); // {0,1}
pairStr = pairStr.substring(1, pairStr.length - 1).trim(); // remove surrounding whitespace and opening "(" and closing ")";
me.println(pairStr);
var pairArr = pairStr.split(delimiterInner);
var fromInstStr = pairArr[0];
var toInstStr = pairArr[1];
var fromInstNode = fromNode.xpath("*[@roleName='" + fromInstStr + "']");
var toInstNode = toNode.xpath("*[@roleName='" + toInstStr + "']");
if (fromPortStr == "4") {fromPortStr = -1;}
fromInstNode.port(fromPortStr, toInstNode);
}
}
}
attStrNode.remove();
}
else if (me["column"]) {
// the 2 sets are 2 "columns" in a "database table" and should both have the same number of elements; map each element in set A to a corresponding element in set B
var eleA = fromNode.first();
var eleB = toNode.first();
while (eleA && eleB) {
me.println(eleA.toString() + " " + fromPortStr + " " + eleB.toString());
eleA.port(fromPortStr, eleB);
eleA = eleA.next();
eleB = eleB.next();
}
}
}
this.cnode.remove();
}}
//# sourceURL=Pairsbehavior.js
]]></Pairsbehavior>
<PhysicalSystembehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[
var me, beh = {
postConfigure: function() {
me = this.cnode.parent();
$wnd.xh.xport("Graphviz", $wnd.xh.root().parent().xpath("Chameleon/PhysicalSystem/XhModel[@roleName='Cell Model']"), '{"gvFileExt":".gv","gvGraph":"digraph","layout":"dot","edgeOp":"->","gvCluster":"","shouldShowStateMachineEntities":false,"filter":"--Behavior,Script,Pairs","nameTemplateNodeId":"^^^^i^","nameTemplateNodeLabel":"R^^^^^","shouldQuoteLabels":true,"shouldShowLinks":true,"shouldShowLinkLabels":false,"shouldSpecifyLayout":false,"maxLabelLen":-1,"shouldColor":true,"defaultNodeColor":"#f0f8ff","bgGraphColor":"white","shouldSpecifyShape":true,"shape":"box","shouldSpecifySize":true,"size":"33","shouldSpecifyFontname":true,"fontname":"Courier","shouldSpecifyArrowhead":true,"arrowhead":"vee","shouldSpecifyStylesheet":true,"stylesheet":"Xholon.css","shouldSpecifyRankdir":true,"rankdir":"LR","shouldDisplayGraph":true,"outputFormat":"svg"}');
this.cnode.remove();
}}
//# 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>NodeXS</title>
<rect id="PhysicalSystem/XhModel/NodeXS" fill="#98FB98" height="50" width="50" x="25" y="0"/>
<g>
<title>NodeXE</title>
<rect id="PhysicalSystem/XhModel/NodeXS/NodeXE" 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