Skip to content

Commit

Permalink
🔨 Transformation now only require one zone (or None) (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
MathisFederico authored Jan 25, 2024
2 parents a769eee + fc81b74 commit 73655d0
Show file tree
Hide file tree
Showing 59 changed files with 873 additions and 783 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-tests-all-optdeps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11']
env:
MPLBACKEND: Agg # https://github.com/orgs/community/discussions/26434
SDL_VIDEODRIVER: "dummy" # for PyGame render https://stackoverflow.com/questions/15933493/pygame-error-no-available-video-device
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ <h1></h1>


// parsing and collecting nodes and edges from the python
nodes = new vis.DataSet([{"color": "red", "id": "item#0", "label": "0", "level": 0, "name": "0", "shape": "dot", "size": 10, "title": "0", "x": 0.0, "y": 0.0}, {"color": "red", "id": "item#1", "label": "1", "level": 1, "name": "1", "shape": "dot", "size": 10, "title": "1", "x": 0.0, "y": 200.0}, {"color": "red", "id": "item#2", "label": "2", "level": 2, "name": "2", "shape": "dot", "size": 10, "title": "2", "x": 0.0, "y": 400.0}, {"color": "red", "id": "item#3", "label": "3", "level": 3, "name": "3", "shape": "dot", "size": 10, "title": "3", "x": 0.0, "y": 600.0}, {"color": "red", "id": "item#4", "label": "4", "level": 4, "name": "4", "shape": "dot", "size": 10, "title": "4", "x": 0.0, "y": 800.0}, {"color": "red", "id": "item#5", "label": "5", "level": 5, "name": "5", "shape": "dot", "size": 10, "title": "5", "x": 0.0, "y": 1000.0}]);
edges = new vis.DataSet([{"arrows": {"middle": {"enabled": true}}, "color": {"color": "#DE8F057F", "highlight": "#DE8F057F", "hover": "#DE8F057F"}, "from": "item#0", "hoverWidth": 0.1, "selectionWidth": 0.1, "smooth": {"enabled": false}, "title": "item_required for 0\u003e1 =\u003e -0,+1 (transformation 1):\n\nConditions:\n0\u003e1\nEffects:\n-0,+1", "to": "item#1", "width": 1}, {"arrows": {"middle": {"enabled": true}}, "color": {"color": "#56B4E97F", "highlight": "#56B4E97F", "hover": "#56B4E97F"}, "from": "item#0", "hoverWidth": 0.1, "selectionWidth": 0.1, "smooth": {"enabled": false}, "title": "item_required for 0\u003e1,1\u003e1 =\u003e -0,-1,+2 (transformation 2):\n\nConditions:\n0\u003e1,1\u003e1\nEffects:\n-0,-1,+2", "to": "item#2", "width": 1}, {"arrows": {"middle": {"enabled": true}}, "color": {"color": "#56B4E97F", "highlight": "#56B4E97F", "hover": "#56B4E97F"}, "from": "item#1", "hoverWidth": 0.1, "selectionWidth": 0.1, "smooth": {"enabled": false}, "title": "item_required for 0\u003e1,1\u003e1 =\u003e -0,-1,+2 (transformation 2):\n\nConditions:\n0\u003e1,1\u003e1\nEffects:\n-0,-1,+2", "to": "item#2", "width": 1}, {"arrows": {"middle": {"enabled": true}}, "color": {"color": "#ECE1337F", "highlight": "#ECE1337F", "hover": "#ECE1337F"}, "from": "item#1", "hoverWidth": 0.1, "selectionWidth": 0.1, "smooth": {"enabled": false}, "title": "item_required for 1\u003e1,2\u003e1 =\u003e -1,-2,+3 (transformation 3):\n\nConditions:\n1\u003e1,2\u003e1\nEffects:\n-1,-2,+3", "to": "item#3", "width": 1}, {"arrows": {"middle": {"enabled": true}}, "color": {"color": "#029E737F", "highlight": "#029E737F", "hover": "#029E737F"}, "from": "item#3", "hoverWidth": 0.1, "selectionWidth": 0.1, "smooth": {"enabled": false}, "title": "item_required for 2\u003e1,3\u003e1 =\u003e -2,-3,+4 (transformation 4):\n\nConditions:\n2\u003e1,3\u003e1\nEffects:\n-2,-3,+4", "to": "item#4", "width": 1}, {"arrows": {"middle": {"enabled": true}}, "color": {"color": "#9494947F", "highlight": "#9494947F", "hover": "#9494947F"}, "from": "item#3", "hoverWidth": 0.1, "selectionWidth": 0.1, "smooth": {"enabled": false}, "title": "item_required for 3\u003e1,4\u003e1 =\u003e -3,-4,+5 (transformation 5):\n\nConditions:\n3\u003e1,4\u003e1\nEffects:\n-3,-4,+5", "to": "item#5", "width": 1}, {"arrows": {"middle": {"enabled": true}}, "color": {"color": "#9494947F", "highlight": "#9494947F", "hover": "#9494947F"}, "from": "item#4", "hoverWidth": 0.1, "selectionWidth": 0.1, "smooth": {"enabled": false}, "title": "item_required for 3\u003e1,4\u003e1 =\u003e -3,-4,+5 (transformation 5):\n\nConditions:\n3\u003e1,4\u003e1\nEffects:\n-3,-4,+5", "to": "item#5", "width": 1}, {"arrows": {"middle": {"enabled": true}}, "color": {"color": "#ECE1337F", "highlight": "#ECE1337F", "hover": "#ECE1337F"}, "from": "item#2", "hoverWidth": 0.1, "selectionWidth": 0.1, "smooth": {"enabled": false}, "title": "item_required for 1\u003e1,2\u003e1 =\u003e -1,-2,+3 (transformation 3):\n\nConditions:\n1\u003e1,2\u003e1\nEffects:\n-1,-2,+3", "to": "item#3", "width": 1}, {"arrows": {"middle": {"enabled": true}}, "color": {"color": "#029E737F", "highlight": "#029E737F", "hover": "#029E737F"}, "from": "item#2", "hoverWidth": 0.1, "selectionWidth": 0.1, "smooth": {"enabled": false}, "title": "item_required for 2\u003e1,3\u003e1 =\u003e -2,-3,+4 (transformation 4):\n\nConditions:\n2\u003e1,3\u003e1\nEffects:\n-2,-3,+4", "to": "item#4", "width": 1}]);
nodes = new vis.DataSet([{"color": "red", "id": "item#4", "label": "4", "level": 4, "name": "4", "shape": "dot", "size": 10, "title": "4", "x": 0.0, "y": 800.0}, {"color": "red", "id": "item#5", "label": "5", "level": 5, "name": "5", "shape": "dot", "size": 10, "title": "5", "x": 0.0, "y": 1000.0}, {"color": "red", "id": "item#3", "label": "3", "level": 3, "name": "3", "shape": "dot", "size": 10, "title": "3", "x": 0.0, "y": 600.0}, {"color": "red", "id": "item#2", "label": "2", "level": 2, "name": "2", "shape": "dot", "size": 10, "title": "2", "x": 0.0, "y": 400.0}, {"color": "red", "id": "item#1", "label": "1", "level": 1, "name": "1", "shape": "dot", "size": 10, "title": "1", "x": 0.0, "y": 200.0}, {"color": "red", "id": "item#0", "label": "0", "level": 0, "name": "0", "shape": "dot", "size": 10, "title": "0", "x": 0.0, "y": 0.0}]);
edges = new vis.DataSet([{"arrows": {"middle": {"enabled": true}}, "color": {"color": "#CC78BC7F", "highlight": "#CC78BC7F", "hover": "#CC78BC7F"}, "from": "item#4", "hoverWidth": 0.1, "selectionWidth": 0.1, "smooth": {"enabled": false}, "title": "item_required for 3\u22651,4\u22651 \u27f9 -3,-4,+5 (transformation 5):\n\nConditions:\n3\u22651,4\u22651\nEffects:\n-3,-4,+5", "to": "item#5", "width": 1}, {"arrows": {"middle": {"enabled": true}}, "color": {"color": "#029E737F", "highlight": "#029E737F", "hover": "#029E737F"}, "from": "item#3", "hoverWidth": 0.1, "selectionWidth": 0.1, "smooth": {"enabled": false}, "title": "item_required for 2\u22651,3\u22651 \u27f9 -2,-3,+4 (transformation 4):\n\nConditions:\n2\u22651,3\u22651\nEffects:\n-2,-3,+4", "to": "item#4", "width": 1}, {"arrows": {"middle": {"enabled": true}}, "color": {"color": "#CC78BC7F", "highlight": "#CC78BC7F", "hover": "#CC78BC7F"}, "from": "item#3", "hoverWidth": 0.1, "selectionWidth": 0.1, "smooth": {"enabled": false}, "title": "item_required for 3\u22651,4\u22651 \u27f9 -3,-4,+5 (transformation 5):\n\nConditions:\n3\u22651,4\u22651\nEffects:\n-3,-4,+5", "to": "item#5", "width": 1}, {"arrows": {"middle": {"enabled": true}}, "color": {"color": "#56B4E97F", "highlight": "#56B4E97F", "hover": "#56B4E97F"}, "from": "item#2", "hoverWidth": 0.1, "selectionWidth": 0.1, "smooth": {"enabled": false}, "title": "item_required for 1\u22651,2\u22651 \u27f9 -1,-2,+3 (transformation 3):\n\nConditions:\n1\u22651,2\u22651\nEffects:\n-1,-2,+3", "to": "item#3", "width": 1}, {"arrows": {"middle": {"enabled": true}}, "color": {"color": "#029E737F", "highlight": "#029E737F", "hover": "#029E737F"}, "from": "item#2", "hoverWidth": 0.1, "selectionWidth": 0.1, "smooth": {"enabled": false}, "title": "item_required for 2\u22651,3\u22651 \u27f9 -2,-3,+4 (transformation 4):\n\nConditions:\n2\u22651,3\u22651\nEffects:\n-2,-3,+4", "to": "item#4", "width": 1}, {"arrows": {"middle": {"enabled": true}}, "color": {"color": "#9494947F", "highlight": "#9494947F", "hover": "#9494947F"}, "from": "item#1", "hoverWidth": 0.1, "selectionWidth": 0.1, "smooth": {"enabled": false}, "title": "item_required for 0\u22651,1\u22651 \u27f9 -0,-1,+2 (transformation 2):\n\nConditions:\n0\u22651,1\u22651\nEffects:\n-0,-1,+2", "to": "item#2", "width": 1}, {"arrows": {"middle": {"enabled": true}}, "color": {"color": "#56B4E97F", "highlight": "#56B4E97F", "hover": "#56B4E97F"}, "from": "item#1", "hoverWidth": 0.1, "selectionWidth": 0.1, "smooth": {"enabled": false}, "title": "item_required for 1\u22651,2\u22651 \u27f9 -1,-2,+3 (transformation 3):\n\nConditions:\n1\u22651,2\u22651\nEffects:\n-1,-2,+3", "to": "item#3", "width": 1}, {"arrows": {"middle": {"enabled": true}}, "color": {"color": "#FBAFE47F", "highlight": "#FBAFE47F", "hover": "#FBAFE47F"}, "from": "item#0", "hoverWidth": 0.1, "selectionWidth": 0.1, "smooth": {"enabled": false}, "title": "item_required for 0\u22651 \u27f9 -0,+1 (transformation 1):\n\nConditions:\n0\u22651\nEffects:\n-0,+1", "to": "item#1", "width": 1}, {"arrows": {"middle": {"enabled": true}}, "color": {"color": "#9494947F", "highlight": "#9494947F", "hover": "#9494947F"}, "from": "item#0", "hoverWidth": 0.1, "selectionWidth": 0.1, "smooth": {"enabled": false}, "title": "item_required for 0\u22651,1\u22651 \u27f9 -0,-1,+2 (transformation 2):\n\nConditions:\n0\u22651,1\u22651\nEffects:\n-0,-1,+2", "to": "item#2", "width": 1}]);

nodeColors = {};
allNodes = nodes.get({ returnType: "Object" });
Expand Down
4 changes: 2 additions & 2 deletions docs/images/requirements_graphs/MineHcraft.html

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/images/requirements_graphs/MiniHCraftCrossing.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ <h1></h1>


// parsing and collecting nodes and edges from the python
nodes = new vis.DataSet([{"color": "blue", "id": "zone_item#lava in zone", "image": "https://raw.githubusercontent.com/IRLL/HierarchyCraft/master/src/hcraft/examples/minicraft/resources/items/lava.png", "label": "Lava in zone", "level": 2, "name": "lava", "shape": "image", "size": 10, "title": "Lava in zone", "x": 0.0, "y": 666.6666666666666}, {"color": "red", "id": "item#lava", "image": "https://raw.githubusercontent.com/IRLL/HierarchyCraft/master/src/hcraft/examples/minicraft/resources/items/lava.png", "label": "Lava", "level": 3, "name": "lava", "shape": "image", "size": 10, "title": "Lava", "x": 0.0, "y": 1000.0}, {"color": "blue", "id": "zone_item#goal in zone", "image": "https://raw.githubusercontent.com/IRLL/HierarchyCraft/master/src/hcraft/examples/minicraft/resources/items/goal.png", "label": "Goal in zone", "level": 2, "name": "goal", "shape": "image", "size": 10, "title": "Goal in zone", "x": 600.0, "y": 666.6666666666666}, {"color": "red", "id": "item#goal", "image": "https://raw.githubusercontent.com/IRLL/HierarchyCraft/master/src/hcraft/examples/minicraft/resources/items/goal.png", "label": "Goal", "level": 3, "name": "goal", "shape": "image", "size": 10, "title": "Goal", "x": 600.0, "y": 1000.0}, {"color": "green", "id": "zone#room", "label": "Room", "level": 1, "name": "room", "shape": "dot", "size": 10, "title": "Room", "x": 0.0, "y": 333.3333333333333}, {"color": "black", "font": {"color": "transparent", "strokeColor": "transparent"}, "id": "START#", "label": "START#", "level": 0, "shape": "dot", "size": 10, "title": "Start", "x": 0.0, "y": 0.0}]);
edges = new vis.DataSet([{"arrows": {"middle": {"enabled": true}}, "color": {"color": "#D55E007F", "highlight": "#D55E007F", "hover": "#D55E007F"}, "from": "zone_item#lava in zone", "hoverWidth": 0.1, "selectionWidth": 0.1, "smooth": {"enabled": false}, "title": "item_required_in_zone for reach_lava (transformation 4):\n\nConditions:\nZone(lava\u003e1)\nEffects:\n+lava", "to": "item#lava", "width": 1}, {"arrows": {"middle": {"enabled": true}}, "color": {"color": "#9494947F", "highlight": "#9494947F", "hover": "#9494947F"}, "from": "zone_item#goal in zone", "hoverWidth": 0.1, "selectionWidth": 0.1, "smooth": {"enabled": false}, "title": "item_required_in_zone for reach_goal (transformation 2):\n\nConditions:\nZone(goal\u003e1)\nEffects:\n+goal", "to": "item#goal", "width": 1}, {"arrows": {"middle": {"enabled": true}}, "color": {"color": "#CA91617F", "highlight": "#CA91617F", "hover": "#CA91617F"}, "from": "zone#room", "hoverWidth": 0.1, "selectionWidth": 0.1, "smooth": {"enabled": false}, "title": "zone_required for find_goal (transformation 1):\n\nConditions:\nZone(goal\u003c0) | room\nEffects:\nZone(+goal)", "to": "zone_item#goal in zone", "width": 1}, {"arrows": {"middle": {"enabled": true}}, "color": {"color": "#029E737F", "highlight": "#029E737F", "hover": "#029E737F"}, "from": "zone#room", "hoverWidth": 0.1, "selectionWidth": 0.1, "smooth": {"enabled": false}, "title": "zone_required for find_lava (transformation 3):\n\nConditions:\nZone(lava\u003c0) | room\nEffects:\nZone(+lava)", "to": "zone_item#lava in zone", "width": 1}, {"arrows": {"middle": {"enabled": true}}, "color": {"color": "#56B4E97F", "highlight": "#56B4E97F", "hover": "#56B4E97F"}, "from": "START#", "hoverWidth": 0.1, "selectionWidth": 0.1, "smooth": {"enabled": false}, "title": "Start_zone", "to": "zone#room", "width": 1}]);
nodes = new vis.DataSet([{"color": "blue", "id": "zone_item#lava in zone", "image": "https://raw.githubusercontent.com/IRLL/HierarchyCraft/master/src/hcraft/examples/minicraft/resources/items/lava.png", "label": "Lava in zone", "level": 2, "name": "lava", "shape": "image", "size": 10, "title": "Lava in zone", "x": 0.0, "y": 666.6666666666666}, {"color": "red", "id": "item#lava", "image": "https://raw.githubusercontent.com/IRLL/HierarchyCraft/master/src/hcraft/examples/minicraft/resources/items/lava.png", "label": "Lava", "level": 3, "name": "lava", "shape": "image", "size": 10, "title": "Lava", "x": 0.0, "y": 1000.0}, {"color": "blue", "id": "zone_item#goal in zone", "image": "https://raw.githubusercontent.com/IRLL/HierarchyCraft/master/src/hcraft/examples/minicraft/resources/items/goal.png", "label": "Goal in zone", "level": 2, "name": "goal", "shape": "image", "size": 10, "title": "Goal in zone", "x": 600.0, "y": 666.6666666666666}, {"color": "red", "id": "item#goal", "image": "https://raw.githubusercontent.com/IRLL/HierarchyCraft/master/src/hcraft/examples/minicraft/resources/items/goal.png", "label": "Goal", "level": 3, "name": "goal", "shape": "image", "size": 10, "title": "Goal", "x": 600.0, "y": 1000.0}, {"color": "green", "id": "zone#room", "label": "Room", "level": 1, "name": "room", "shape": "dot", "size": 10, "title": "Room", "x": 600.0, "y": 333.3333333333333}, {"color": "black", "font": {"color": "transparent", "strokeColor": "transparent"}, "id": "START#", "label": "START#", "level": 0, "shape": "dot", "size": 10, "title": "Start", "x": 600.0, "y": 0.0}]);
edges = new vis.DataSet([{"arrows": {"middle": {"enabled": true}}, "color": {"color": "#FBAFE47F", "highlight": "#FBAFE47F", "hover": "#FBAFE47F"}, "from": "zone_item#lava in zone", "hoverWidth": 0.1, "selectionWidth": 0.1, "smooth": {"enabled": false}, "title": "item_required_in_zone for reach_lava (transformation 3):\n\nConditions:\nZone(lava\u22651)\nEffects:\n+lava", "to": "item#lava", "width": 1}, {"arrows": {"middle": {"enabled": true}}, "color": {"color": "#CC78BC7F", "highlight": "#CC78BC7F", "hover": "#CC78BC7F"}, "from": "zone_item#goal in zone", "hoverWidth": 0.1, "selectionWidth": 0.1, "smooth": {"enabled": false}, "title": "item_required_in_zone for reach_goal (transformation 1):\n\nConditions:\nZone(goal\u22651)\nEffects:\n+goal", "to": "item#goal", "width": 1}, {"arrows": {"middle": {"enabled": true}}, "color": {"color": "#029E737F", "highlight": "#029E737F", "hover": "#029E737F"}, "from": "zone#room", "hoverWidth": 0.1, "selectionWidth": 0.1, "smooth": {"enabled": false}, "title": "zone_required for find_goal (transformation 0):\n\nConditions:\nZone(goal\u22640) | at room\nEffects:\nZone(+goal)", "to": "zone_item#goal in zone", "width": 1}, {"arrows": {"middle": {"enabled": true}}, "color": {"color": "#ECE1337F", "highlight": "#ECE1337F", "hover": "#ECE1337F"}, "from": "zone#room", "hoverWidth": 0.1, "selectionWidth": 0.1, "smooth": {"enabled": false}, "title": "zone_required for find_lava (transformation 2):\n\nConditions:\nZone(lava\u22640) | at room\nEffects:\nZone(+lava)", "to": "zone_item#lava in zone", "width": 1}, {"arrows": {"middle": {"enabled": true}}, "color": {"color": "#0173B27F", "highlight": "#0173B27F", "hover": "#0173B27F"}, "from": "START#", "hoverWidth": 0.1, "selectionWidth": 0.1, "smooth": {"enabled": false}, "title": "Start_zone", "to": "zone#room", "width": 1}]);

nodeColors = {};
allNodes = nodes.get({ returnType: "Object" });
Expand Down
Loading

0 comments on commit 73655d0

Please sign in to comment.