Skip to content

Commit

Permalink
fix-broken-notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
YouGuessedMyName committed Dec 22, 2024
1 parent 62879b8 commit e865553
Show file tree
Hide file tree
Showing 6 changed files with 3,386 additions and 5,558 deletions.
227 changes: 217 additions & 10 deletions docs/getting_started/00_die.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -29,20 +29,227 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 2,
"metadata": {
"scrolled": true
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "cf5b93f04979440fb90deb4442419600",
"version_major": 2,
"version_minor": 0
},
"text/html": [
"\n",
" <iframe\n",
" id=\"diehpOPtbbKyg\"\n",
" width=\"820\"\n",
" height=\"620\"\n",
" frameborder=\"0\"\n",
" srcdoc=\"\n",
"&lt;!DOCTYPE html&gt;\n",
"&lt;html lang=&quot;en&quot;&gt;\n",
" &lt;head&gt;\n",
" &lt;title&gt;Network&lt;/title&gt;\n",
" &lt;script\n",
" type=&quot;text/javascript&quot;\n",
" src=&quot;https://unpkg.com/vis-network/standalone/umd/vis-network.min.js&quot;\n",
" &gt;&lt;/script&gt;\n",
" &lt;style type=&quot;text/css&quot;&gt;\n",
" #mynetwork {\n",
" \n",
" width: 800px;\n",
" height: 600px;\n",
" border: 1px solid lightgray;\n",
" \n",
" }\n",
" &lt;/style&gt;\n",
" &lt;/head&gt;\n",
" &lt;body&gt;\n",
" &lt;div id=&quot;mynetwork&quot;&gt;&lt;/div&gt;\n",
" &lt;script type=&quot;text/javascript&quot;&gt;\n",
" \n",
" var nodes = new vis.DataSet([{ id: 0, label: `init`, group: &quot;states&quot; },\n",
"{ id: 1, label: `rolled1`, group: &quot;states&quot; },\n",
"{ id: 2, label: `rolled2`, group: &quot;states&quot; },\n",
"{ id: 3, label: `rolled3`, group: &quot;states&quot; },\n",
"{ id: 4, label: `rolled4`, group: &quot;states&quot; },\n",
"{ id: 5, label: `rolled5`, group: &quot;states&quot; },\n",
"{ id: 6, label: `rolled6`, group: &quot;states&quot; },\n",
"]);\n",
" var edges = new vis.DataSet([{ from: 0, to: 1, label: &quot;1/6&quot; },\n",
"{ from: 0, to: 2, label: &quot;1/6&quot; },\n",
"{ from: 0, to: 3, label: &quot;1/6&quot; },\n",
"{ from: 0, to: 4, label: &quot;1/6&quot; },\n",
"{ from: 0, to: 5, label: &quot;1/6&quot; },\n",
"{ from: 0, to: 6, label: &quot;1/6&quot; },\n",
"{ from: 1, to: 1, label: &quot;1&quot; },\n",
"{ from: 2, to: 2, label: &quot;1&quot; },\n",
"{ from: 3, to: 3, label: &quot;1&quot; },\n",
"{ from: 4, to: 4, label: &quot;1&quot; },\n",
"{ from: 5, to: 5, label: &quot;1&quot; },\n",
"{ from: 6, to: 6, label: &quot;1&quot; },\n",
"]);\n",
" var options = {\n",
" &quot;__fake_macros&quot;: {\n",
" &quot;__group_macro&quot;: {\n",
" &quot;borderWidth&quot;: 1,\n",
" &quot;color&quot;: {\n",
" &quot;background&quot;: &quot;white&quot;,\n",
" &quot;border&quot;: &quot;black&quot;,\n",
" &quot;highlight&quot;: {\n",
" &quot;background&quot;: &quot;white&quot;,\n",
" &quot;border&quot;: &quot;red&quot;\n",
" }\n",
" },\n",
" &quot;shape&quot;: &quot;ellipse&quot;,\n",
" &quot;mass&quot;: 1,\n",
" &quot;font&quot;: {\n",
" &quot;color&quot;: &quot;black&quot;,\n",
" &quot;size&quot;: 14\n",
" }\n",
" }\n",
" },\n",
" &quot;groups&quot;: {\n",
" &quot;states&quot;: {\n",
" &quot;borderWidth&quot;: 1,\n",
" &quot;color&quot;: {\n",
" &quot;background&quot;: &quot;white&quot;,\n",
" &quot;border&quot;: &quot;black&quot;,\n",
" &quot;highlight&quot;: {\n",
" &quot;background&quot;: &quot;white&quot;,\n",
" &quot;border&quot;: &quot;red&quot;\n",
" }\n",
" },\n",
" &quot;shape&quot;: &quot;ellipse&quot;,\n",
" &quot;mass&quot;: 1,\n",
" &quot;font&quot;: {\n",
" &quot;color&quot;: &quot;black&quot;,\n",
" &quot;size&quot;: 14\n",
" }\n",
" },\n",
" &quot;actions&quot;: {\n",
" &quot;borderWidth&quot;: 1,\n",
" &quot;color&quot;: {\n",
" &quot;background&quot;: &quot;lightblue&quot;,\n",
" &quot;border&quot;: &quot;black&quot;,\n",
" &quot;highlight&quot;: {\n",
" &quot;background&quot;: &quot;white&quot;,\n",
" &quot;border&quot;: &quot;red&quot;\n",
" }\n",
" },\n",
" &quot;shape&quot;: &quot;box&quot;,\n",
" &quot;mass&quot;: 1,\n",
" &quot;font&quot;: {\n",
" &quot;color&quot;: &quot;black&quot;,\n",
" &quot;size&quot;: 14\n",
" }\n",
" },\n",
" &quot;scheduled_actions&quot;: {\n",
" &quot;borderWidth&quot;: 1,\n",
" &quot;color&quot;: {\n",
" &quot;background&quot;: &quot;pink&quot;,\n",
" &quot;border&quot;: &quot;black&quot;,\n",
" &quot;highlight&quot;: {\n",
" &quot;background&quot;: &quot;white&quot;,\n",
" &quot;border&quot;: &quot;red&quot;\n",
" }\n",
" },\n",
" &quot;shape&quot;: &quot;box&quot;,\n",
" &quot;mass&quot;: 1,\n",
" &quot;font&quot;: {\n",
" &quot;color&quot;: &quot;black&quot;,\n",
" &quot;size&quot;: 14\n",
" },\n",
" &quot;schedColor&quot;: false\n",
" }\n",
" },\n",
" &quot;reload_button&quot;: false,\n",
" &quot;edges&quot;: {\n",
" &quot;arrows&quot;: &quot;to&quot;,\n",
" &quot;font&quot;: {\n",
" &quot;color&quot;: &quot;black&quot;,\n",
" &quot;size&quot;: 14\n",
" },\n",
" &quot;color&quot;: {\n",
" &quot;color&quot;: &quot;black&quot;\n",
" }\n",
" },\n",
" &quot;numbers&quot;: {\n",
" &quot;fractions&quot;: true,\n",
" &quot;digits&quot;: 5\n",
" },\n",
" &quot;state_properties&quot;: {\n",
" &quot;show_results&quot;: true,\n",
" &quot;result_symbol&quot;: &quot;\\u2606&quot;,\n",
" &quot;show_rewards&quot;: true,\n",
" &quot;reward_symbol&quot;: &quot;\\u20ac&quot;,\n",
" &quot;show_zero_rewards&quot;: true,\n",
" &quot;show_observations&quot;: true,\n",
" &quot;observation_symbol&quot;: &quot;\\u0298&quot;\n",
" },\n",
" &quot;layout&quot;: {\n",
" &quot;randomSeed&quot;: 5\n",
" },\n",
" &quot;misc&quot;: {\n",
" &quot;enable_physics&quot;: true,\n",
" &quot;width&quot;: 800,\n",
" &quot;height&quot;: 600,\n",
" &quot;explore&quot;: false\n",
" },\n",
" &quot;saving&quot;: {\n",
" &quot;relative_path&quot;: true,\n",
" &quot;filename&quot;: &quot;layouts/NAME.json&quot;,\n",
" &quot;save_button&quot;: false,\n",
" &quot;load_button&quot;: false\n",
" },\n",
" &quot;positions&quot;: {},\n",
" &quot;width&quot;: 800,\n",
" &quot;height&quot;: 600,\n",
" &quot;physics&quot;: true\n",
"};\n",
" //js\n",
"var container = document.getElementById(&quot;mynetwork&quot;);\n",
"var data = {\n",
" nodes: nodes,\n",
" edges: edges,\n",
"};\n",
"var network = new vis.Network(container, data, options);\n",
"function makeAllNodesInvisible() {\n",
" ids = nodes.getIds();\n",
" for (let i = 0; i &lt; ids.length; i++) {\n",
" var nodeId = ids[i];\n",
" var node = nodes.get(nodeId);\n",
" node[&quot;hidden&quot;] = true;\n",
" nodes.update(node);\n",
" }\n",
"};\n",
"function makeNeighborsVisible(myNode) {\n",
" var ids = network.getConnectedNodes(myNode, &#x27;to&#x27;);\n",
" for (let i = 0; i &lt; ids.length; i++) {\n",
" var nodeId = ids[i];\n",
" var node = nodes.get(nodeId);\n",
" node[&quot;hidden&quot;] = false;\n",
" nodes.update(node);\n",
" }\n",
"};\n",
"function makeNodeVisible(nodeId) {\n",
" var node = nodes.get(nodeId);\n",
" node[&quot;hidden&quot;] = false;\n",
" nodes.update(node);\n",
"};\n",
"network.on( &#x27;click&#x27;, function(properties) {\n",
" var nodeId = network.getNodeAt({x:properties.event.srcEvent.offsetX, y:properties.event.srcEvent.offsetY});\n",
" makeNeighborsVisible(nodeId);\n",
"});\n",
"\n",
" &lt;/script&gt;\n",
" &lt;/body&gt;\n",
"&lt;/html&gt;\n",
"\"\n",
" border:none !important;\n",
" allowfullscreen webkitallowfullscreen mozallowfullscreen\n",
" ></iframe>"
],
"text/plain": [
"Output()"
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
Expand Down Expand Up @@ -72,7 +279,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -88,7 +295,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand Down
Loading

0 comments on commit e865553

Please sign in to comment.