-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
429ef18
commit 1472ac7
Showing
5 changed files
with
269 additions
and
333 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,145 +1,102 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import stormvogel.model\n", | ||
"import stormvogel.visualization" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Create a new model with the name \"Die\"\n", | ||
"dtmc = stormvogel.model.new_dtmc(\"Die\")\n", | ||
"\n", | ||
"init = dtmc.get_initial_state()\n", | ||
"\n", | ||
"# From the initial state, add the transition to 6 new states with probability 1/6th.\n", | ||
"init.set_transitions(\n", | ||
" [(1 / 6, dtmc.new_state(f\"rolled{i}\", {\"rolled\": i})) for i in range(6)]\n", | ||
")\n", | ||
"\n", | ||
"# Print the resulting model in dot format.\n", | ||
"# print(dtmc.to_dot())" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"metadata": { | ||
"scrolled": true | ||
}, | ||
"outputs": [ | ||
"cells": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"diegraph.html\n" | ||
] | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import stormvogel.model\n", | ||
"import stormvogel.visualization" | ||
] | ||
}, | ||
{ | ||
"data": { | ||
"text/html": [ | ||
"\n", | ||
" <iframe\n", | ||
" width=\"100%\"\n", | ||
" height=\"600px\"\n", | ||
" src=\"diegraph.html\"\n", | ||
" frameborder=\"0\"\n", | ||
" allowfullscreen\n", | ||
" \n", | ||
" ></iframe>\n", | ||
" " | ||
], | ||
"text/plain": [ | ||
"<IPython.lib.display.IFrame at 0x7ff90d17b510>" | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Create a new model with the name \"Die\"\n", | ||
"dtmc = stormvogel.model.new_dtmc(\"Die\")\n", | ||
"\n", | ||
"init = dtmc.get_initial_state()\n", | ||
"\n", | ||
"# From the initial state, add the transition to 6 new states with probability 1/6th.\n", | ||
"init.set_transitions(\n", | ||
" [(1 / 6, dtmc.new_state(f\"rolled{i}\", {\"rolled\": i})) for i in range(6)]\n", | ||
")\n", | ||
"\n", | ||
"# Print the resulting model in dot format.\n", | ||
"# print(dtmc.to_dot())" | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
} | ||
], | ||
"source": [ | ||
"stormvogel.visualization.show(model=dtmc, name=\"diegraph\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"hi.html\n" | ||
] | ||
}, | ||
{ | ||
"data": { | ||
"text/html": [ | ||
"\n", | ||
" <iframe\n", | ||
" width=\"100%\"\n", | ||
" height=\"600px\"\n", | ||
" src=\"hi.html\"\n", | ||
" frameborder=\"0\"\n", | ||
" allowfullscreen\n", | ||
" \n", | ||
" ></iframe>\n", | ||
" " | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"metadata": { | ||
"scrolled": true | ||
}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"diegraph.html\n" | ||
] | ||
}, | ||
{ | ||
"data": { | ||
"text/html": [ | ||
"\n", | ||
" <iframe\n", | ||
" width=\"100%\"\n", | ||
" height=\"600px\"\n", | ||
" src=\"diegraph.html\"\n", | ||
" frameborder=\"0\"\n", | ||
" allowfullscreen\n", | ||
" \n", | ||
" ></iframe>\n", | ||
" " | ||
], | ||
"text/plain": [ | ||
"<IPython.lib.display.IFrame at 0x7efdc3cc9010>" | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
} | ||
], | ||
"text/plain": [ | ||
"<IPython.lib.display.IFrame at 0x7ff90ec3a110>" | ||
"source": [ | ||
"stormvogel.visualization.show(model=dtmc, name=\"diegraph\")" | ||
] | ||
}, | ||
"execution_count": 4, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.11.2" | ||
} | ||
], | ||
"source": [ | ||
"from pyvis.network import Network\n", | ||
"\n", | ||
"g = Network(notebook=True,cdn_resources=\"remote\")\n", | ||
"g.show_buttons()\n", | ||
"g.show(\"hi.html\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.11.2" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.