Skip to content
Snippets Groups Projects
Commit 229996d1 authored by gastentwickler's avatar gastentwickler
Browse files

Update VisB Visualization for Jars and Train B Book

parent cd4d3933
No related branches found
No related tags found
No related merge requests found
......@@ -2,116 +2,129 @@
"svg":"Jars.svg",
"items": [
{
"id": "jar_3_full",
"id": "jar_%0_full",
"attr": "height",
"value": "level(j3) * 20"
"value": "level(j%0) * 20",
"repeat": [
["3"], ["5"]
]
},
{
"id": "jar_%0_text",
"attr": "text",
"value": "level(j%0)",
"repeat": [
["3"], ["5"]
]
},
{
"id": "jar_3_svg",
"id": "jar_%0_svg",
"attr": "height",
"value": "maxf(j3) * 20"
"value": "maxf(j%0) * 20",
"repeat": [
["3"], ["5"]
]
},
{
"id": "jar_3_svg",
"id": "jar_%0_svg",
"attr": "y",
"value": "0 -(max({maxf(j3), maxf(j5)}) * 20 - 100)"
"value": "0 -(max({maxf(j3), maxf(j5)}) * 20 - 100)",
"repeat": [
["3"], ["5"]
]
},
{
"id": "jar_3_empty",
"id": "jar_%0_empty",
"attr": "height",
"value": "maxf(j3) * 20"
"value": "maxf(j%0) * 20",
"repeat": [
["3"], ["5"]
]
},
{
"id": "left_3",
"id": "left_%0",
"attr": "y2",
"value": "maxf(j3) * 20"
"value": "maxf(j%0) * 20",
"repeat": [
["3"], ["5"]
]
},
{
"id": "right_3",
"id": "right_%0",
"attr": "y2",
"value": "maxf(j3) * 20"
"value": "maxf(j%0) * 20",
"repeat": [
["3"], ["5"]
]
},
{
"id": "jar_5_full",
"attr": "height",
"value": "level(j5) * 20"
"id": "goal_achieved",
"attr": "opacity",
"value": "IF max({level(j3), level(j5)}) = max({maxf(j3), maxf(j5)}) -1 THEN 1 ELSE 0 END"
},
{
"id": "jar_5_svg",
"attr": "height",
"value": "maxf(j5) * 20"
"id": "transfer_left",
"attr": "opacity",
"value": "IF level(j3) = maxf(j3) THEN 0 ELSE IF level(j5) = 0 THEN 0 ELSE 1 END END"
},
{
"id": "jar_5_svg",
"attr": "y",
"value": "0 -(max({maxf(j3), maxf(j5)}) * 20 - 100)"
"id": "transfer_right",
"attr": "opacity",
"value": "IF level(j5) = maxf(j5) THEN 0 ELSE IF level(j3) = 0 THEN 0 ELSE 1 END END"
},
{
"id": "jar_5_empty",
"attr": "height",
"value": "maxf(j5) * 20"
"id": "transfer_sym3",
"attr": "opacity",
"value": "IF level(j3) = 0 & level(j5) = 0 THEN 0 ELSE IF level(j3) = maxf(j3) & level(j5) = maxf(j5) THEN 0 ELSE 1 END END"
},
{
"id": "left_5",
"attr": "y2",
"value": "maxf(j5) * 20"
"id": "goal",
"attr": "x1",
"value": "IF maxf(j3) > maxf(j5) THEN 2 ELSE 107 END"
},
{
"id": "right_5",
"attr": "y2",
"value": "maxf(j5) * 20"
"id": "goal",
"attr": "x2",
"value": "IF maxf(j3) > maxf(j5) THEN 48 ELSE 153 END"
}
],
"events": [
{
"id": "fill_3",
"event": "FillJar",
"predicates": ["j=j3"],
"hovers": [{ "attr":"stroke-width", "enter":"6", "leave":"1"},
{ "attr":"opacity", "enter":"0.8", "leave":"1.0"}]
},
{
"id": "fill_3_sym",
"event": "FillJar",
"predicates": ["j=j3"]
},
{
"id": "fill_5",
"id": "fill_%0",
"event": "FillJar",
"predicates": ["j=j5"],
"predicates": ["j=j%0"],
"hovers": [{ "attr":"stroke-width", "enter":"6", "leave":"1"},
{ "attr":"opacity", "enter":"0.8", "leave":"1.0"}]
{ "attr":"opacity", "enter":"0.8", "leave":"1.0"}],
"repeat": [
["3"], ["5"]
]
},
{
"id": "fill_5_sym",
"id": "fill_%0_sym",
"event": "FillJar",
"predicates": ["j=j5"]
},
{
"id": "empty_3",
"event": "EmptyJar",
"predicates": ["j=j3"],
"hovers": [{ "attr":"stroke-width", "enter":"6", "leave":"1"},
{ "attr":"opacity", "enter":"0.8", "leave":"1.0"}]
},
{
"id": "empty_3_sym",
"event": "EmptyJar",
"predicates": ["j=j3"]
"predicates": ["j=j%0"],
"repeat": [
["3"], ["5"]
]
},
{
"id": "empty_5",
"id": "empty_%0",
"event": "EmptyJar",
"predicates": ["j=j5"],
"predicates": ["j=j%0"],
"repeat": [
["3"], ["5"]
],
"hovers": [{ "attr":"stroke-width", "enter":"6", "leave":"1"},
{ "attr":"opacity", "enter":"0.8", "leave":"1.0"}]
},
{
"id": "empty_5_sym",
"id": "empty_%0_sym",
"event": "EmptyJar",
"predicates": ["j=j5"]
"predicates": ["j=j%0"],
"repeat": [
["3"], ["5"]
]
},
{
"id": "transfer",
......@@ -120,11 +133,11 @@
{ "attr":"opacity", "enter":"0.8", "leave":"1.0"}]
},
{
"id": "transfer_sym1",
"id": "transfer_left",
"event": "Transfer"
},
{
"id": "transfer_sym2",
"id": "transfer_right",
"event": "Transfer"
},
{
......
......@@ -11,6 +11,7 @@
<line x1="50" y1="0" x2="0" y2="0" style="stroke:#000000;stroke-width:4"/>
</svg>
</g>
<text id="jar_3_text" opacity="1" x="20" y="95">0</text>
<g id="jar_5" transform="rotate(180 130 100)">
<svg id="jar_5_svg" width="50" height="100" x="105" y="0">
......@@ -22,6 +23,8 @@
<line x1="50" y1="0" x2="0" y2="0" style="stroke:#000000;stroke-width:4"/>
</svg>
</g>
<text id="jar_5_text" opacity="1" x="125" y="95">0</text>
<line id="goal" x1="107" y1="120" x2="153" y2="120" stroke-width="2" stroke="#FF7777"/>
<circle id="fill_3" cx="25" cy="25" r="15" fill="#BBBBBB"/>
<rect id="fill_3_sym" x="20" y="20" width="10" height="12" style="fill:#267CEB"/>
......@@ -32,6 +35,7 @@
<circle id="empty_5" cx="130" cy="65" r="15" fill="#BBBBBB"/>
<rect id="empty_5_sym" x="125" y="60" width="10" height="12" style="fill:#DDEEFF"/>
<circle id="transfer" cx="77.5" cy="45" r="15" fill="#BBBBBB"/>
<polyline id="transfer_sym1" points="70,45 76,41 76,49" fill="#00000"/>
<polyline id="transfer_sym2" points="85,45 79,41 79,49" fill="#00000"/>
<polyline id="transfer_left" points="70,45 76,41 76,49" fill="#00000"/>
<polyline id="transfer_right" points="85,45 79,41 79,49" fill="#00000"/>
<rect id="transfer_sym3" x="76" y="43.5" height="3" width="3"/>
<text id="goal_achieved" opacity="0" x="160" y="125" fill="#FF4444" font-weight="bold">Goal achieved!</text>
......@@ -3,74 +3,12 @@
"comment": "File for train_4 with Beebook topology",
"items": [
{
"id": "a",
"id": "%0",
"attr": "stroke",
"value": "IF A : OCC THEN \"#FF2222\" ELSE IF A : resbl THEN \"#2222FF\" ELSE \"#000000\" END END"
},
{
"id": "b",
"attr": "stroke",
"value": "IF B : OCC THEN \"#FF2222\" ELSE IF B : resbl THEN \"#2222FF\" ELSE \"#000000\" END END"
},
{
"id": "c",
"attr": "stroke",
"value": "IF C : OCC THEN \"#FF2222\" ELSE IF C : resbl THEN \"#2222FF\" ELSE \"#000000\" END END"
},
{
"id": "d",
"attr": "stroke",
"value": "IF D : OCC THEN \"#FF2222\" ELSE IF D : resbl THEN \"#2222FF\" ELSE \"#000000\" END END"
},
{
"id": "e",
"attr": "stroke",
"value": "IF E : OCC THEN \"#FF2222\" ELSE IF E : resbl THEN \"#2222FF\" ELSE \"#000000\" END END"
},
{
"id": "f",
"attr": "stroke",
"value": "IF F : OCC THEN \"#FF2222\" ELSE IF F : resbl THEN \"#2222FF\" ELSE \"#000000\" END END"
},
{
"id": "g",
"attr": "stroke",
"value": "IF G : OCC THEN \"#FF2222\" ELSE IF G : resbl THEN \"#2222FF\" ELSE \"#000000\" END END"
},
{
"id": "h",
"attr": "stroke",
"value": "IF H : OCC THEN \"#FF2222\" ELSE IF H : resbl THEN \"#2222FF\" ELSE \"#000000\" END END"
},
{
"id": "i",
"attr": "stroke",
"value": "IF I : OCC THEN \"#FF2222\" ELSE IF I : resbl THEN \"#2222FF\" ELSE \"#000000\" END END"
},
{
"id": "j",
"attr": "stroke",
"value": "IF J : OCC THEN \"#FF2222\" ELSE IF J : resbl THEN \"#2222FF\" ELSE \"#000000\" END END"
},
{
"id": "k",
"attr": "stroke",
"value": "IF K : OCC THEN \"#FF2222\" ELSE IF K : resbl THEN \"#2222FF\" ELSE \"#000000\" END END"
},
{
"id": "l",
"attr": "stroke",
"value": "IF L : OCC THEN \"#FF2222\" ELSE IF L : resbl THEN \"#2222FF\" ELSE \"#000000\" END END"
},
{
"id": "m",
"attr": "stroke",
"value": "IF M : OCC THEN \"#FF2222\" ELSE IF M : resbl THEN \"#2222FF\" ELSE \"#000000\" END END"
},
{
"id": "n",
"attr": "stroke",
"value": "IF N : OCC THEN \"#FF2222\" ELSE IF N : resbl THEN \"#2222FF\" ELSE \"#000000\" END END"
"value": "IF %0 : OCC THEN \"#FF2222\" ELSE IF %0 : resbl THEN \"#2222FF\" ELSE \"#000000\" END END",
"repeat": [
["A"], ["B"], ["C"], ["D"], ["E"], ["F"], ["G"], ["H"], ["I"], ["J"], ["K"], ["L"], ["M"], ["N"]
]
},
{
"for": {"from":1, "to":5},
......@@ -85,9 +23,41 @@
"attr": "fill",
"value": "IF S%0 : GRN THEN \"#FFD5D5\" ELSE \"#FF2222\" END",
"optional": "true"
},
{
"id": "%0-%1",
"attr": "stroke",
"value": "IF (%0,%1) : (TRK\\/TRK~) THEN IF %0 : OCC THEN \"#FF2222\" ELSIF %0 : resbl THEN \"#2222FF\" ELSE \"#000000\" END ELSIF %0 /: (dom(TRK)\\/ran(TRK)) & %0 : resbl THEN \"#8899FF\" ELSE \"#000000\" END",
"repeat": [
["B","C"], ["B","D"],["D","E"], ["D","K"],["F","E"],["F","K"],["I","K"],["I","J"],["J","K"],["J","I"],["K","D"],["K","I"]
]
}
],
"events": [
{
"id": "s1",
"event": "route_formation",
"predicates": ["r : {R1,R2,R3}"]
},
{
"id": "s2",
"event": "route_formation",
"predicates": ["r : {R4,R5}"]
},
{
"id": "s4",
"event": "route_formation",
"predicates": ["r : {R6,R10}"]
},
{
"id": "s5",
"event": "route_formation",
"predicates": ["r : {R7,R9}"]
},
{
"id": "s3",
"event": "route_formation",
"predicates": ["r=R8"]
}
]
}
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment