Skip to content

Instantly share code, notes, and snippets.

@bosonbaas
Created July 15, 2021 13:55
Show Gist options
  • Save bosonbaas/3af6da34df816a63b1bf3cbf1776d70f to your computer and use it in GitHub Desktop.
Save bosonbaas/3af6da34df816a63b1bf3cbf1776d70f to your computer and use it in GitHub Desktop.
Petrinet model mutation demo
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Model Mutation Example"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"using AlgebraicPetri\n",
"include(\"src/GrometInterop.jl\")\n",
"include(\"src/Mutation.jl\")\n",
"using .GrometInterop\n",
"using .PetriMutations\n",
"\n",
"using JSON"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## SIR -> SEIR\n",
"The first example describes how the SIR model can be mutated into the SEIR model. For this, we will need to define the original model, the pattern to match to, and what to replace the pattern with."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"# Import model, pattern, and replacement\n",
"sir = gromet2petrinet(\"sir_gromet.json\")\n",
"inf = gromet2petrinet(\"inf_gromet.json\")\n",
"exposure = gromet2petrinet(\"exp_gromet.json\");"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
"<!-- Generated by graphviz version 2.47.3 (20210619.1520)\n",
" -->\n",
"<!-- Title: G Pages: 1 -->\n",
"<svg width=\"393pt\" height=\"53pt\"\n",
" viewBox=\"0.00 0.00 392.69 53.50\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 49.5)\">\n",
"<title>G</title>\n",
"<polygon fill=\"white\" stroke=\"transparent\" points=\"-4,4 -4,-49.5 388.69,-49.5 388.69,4 -4,4\"/>\n",
"<!-- J:S -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>J:S</title>\n",
"<ellipse fill=\"#6c9ac3\" stroke=\"#6c9ac3\" cx=\"22.1\" cy=\"-22.75\" rx=\"22.2\" ry=\"22.2\"/>\n",
"<text text-anchor=\"middle\" x=\"22.1\" y=\"-19.05\" font-family=\"Times,serif\" font-size=\"14.00\">J:S</text>\n",
"</g>\n",
"<!-- J:inf -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>J:inf</title>\n",
"<polygon fill=\"#e28f41\" stroke=\"#e28f41\" points=\"128.2,-43.25 87.2,-43.25 87.2,-2.25 128.2,-2.25 128.2,-43.25\"/>\n",
"<text text-anchor=\"middle\" x=\"107.7\" y=\"-19.05\" font-family=\"Times,serif\" font-size=\"14.00\">J:inf</text>\n",
"</g>\n",
"<!-- J:S&#45;&gt;J:inf -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>J:S&#45;&gt;J:inf</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M44.63,-22.75C54.42,-22.75 66.18,-22.75 76.81,-22.75\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"76.96,-26.25 86.96,-22.75 76.96,-19.25 76.96,-26.25\"/>\n",
"<text text-anchor=\"middle\" x=\"65.7\" y=\"-26.55\" font-family=\"Times,serif\" font-size=\"14.00\">1</text>\n",
"</g>\n",
"<!-- J:I -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>J:I</title>\n",
"<ellipse fill=\"#6c9ac3\" stroke=\"#6c9ac3\" cx=\"190.69\" cy=\"-22.75\" rx=\"19.5\" ry=\"19.5\"/>\n",
"<text text-anchor=\"middle\" x=\"190.69\" y=\"-19.05\" font-family=\"Times,serif\" font-size=\"14.00\">J:I</text>\n",
"</g>\n",
"<!-- J:I&#45;&gt;J:inf -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>J:I&#45;&gt;J:inf</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M173.58,-12.82C167.43,-9.57 160.21,-6.38 153.2,-4.75 148.05,-3.55 142.73,-4.05 137.63,-5.47\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"136.24,-2.26 128.2,-9.16 138.79,-8.78 136.24,-2.26\"/>\n",
"<text text-anchor=\"middle\" x=\"149.7\" y=\"-8.55\" font-family=\"Times,serif\" font-size=\"14.00\">1</text>\n",
"</g>\n",
"<!-- J:rec -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>J:rec</title>\n",
"<polygon fill=\"#e28f41\" stroke=\"#e28f41\" points=\"296.19,-44.25 253.19,-44.25 253.19,-1.25 296.19,-1.25 296.19,-44.25\"/>\n",
"<text text-anchor=\"middle\" x=\"274.69\" y=\"-19.05\" font-family=\"Times,serif\" font-size=\"14.00\">J:rec</text>\n",
"</g>\n",
"<!-- J:I&#45;&gt;J:rec -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>J:I&#45;&gt;J:rec</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M210.3,-22.75C219.97,-22.75 232.03,-22.75 243.04,-22.75\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"243.14,-26.25 253.14,-22.75 243.14,-19.25 243.14,-26.25\"/>\n",
"<text text-anchor=\"middle\" x=\"231.69\" y=\"-26.55\" font-family=\"Times,serif\" font-size=\"14.00\">1</text>\n",
"</g>\n",
"<!-- J:R -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>J:R</title>\n",
"<ellipse fill=\"#6c9ac3\" stroke=\"#6c9ac3\" cx=\"361.94\" cy=\"-22.75\" rx=\"23\" ry=\"23\"/>\n",
"<text text-anchor=\"middle\" x=\"361.94\" y=\"-19.05\" font-family=\"Times,serif\" font-size=\"14.00\">J:R</text>\n",
"</g>\n",
"<!-- J:inf&#45;&gt;J:I -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>J:inf&#45;&gt;J:I</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M128.3,-22.75C138.07,-22.75 150.06,-22.75 160.84,-22.75\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"161.1,-26.25 171.1,-22.75 161.1,-19.25 161.1,-26.25\"/>\n",
"<text text-anchor=\"middle\" x=\"149.7\" y=\"-26.55\" font-family=\"Times,serif\" font-size=\"14.00\">2</text>\n",
"</g>\n",
"<!-- J:rec&#45;&gt;J:R -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>J:rec&#45;&gt;J:R</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M296.33,-22.75C306.11,-22.75 318.02,-22.75 328.94,-22.75\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"329,-26.25 339,-22.75 329,-19.25 329,-26.25\"/>\n",
"<text text-anchor=\"middle\" x=\"317.69\" y=\"-26.55\" font-family=\"Times,serif\" font-size=\"14.00\">1</text>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"Graph(\"G\", true, \"dot\", Catlab.Graphics.Graphviz.Statement[Catlab.Graphics.Graphviz.Node(\"\\\"J:S\\\"\", OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:shape => \"circle\", :color => \"#6C9AC3\")), Catlab.Graphics.Graphviz.Node(\"\\\"J:I\\\"\", OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:shape => \"circle\", :color => \"#6C9AC3\")), Catlab.Graphics.Graphviz.Node(\"\\\"J:R\\\"\", OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:shape => \"circle\", :color => \"#6C9AC3\")), Catlab.Graphics.Graphviz.Node(\"\\\"J:inf\\\"\", OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:shape => \"square\", :color => \"#E28F41\")), Catlab.Graphics.Graphviz.Node(\"\\\"J:rec\\\"\", OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:shape => \"square\", :color => \"#E28F41\")), Catlab.Graphics.Graphviz.Edge(Catlab.Graphics.Graphviz.NodeID[Catlab.Graphics.Graphviz.NodeID(\"\\\"J:I\\\"\", \"\", \"\"), Catlab.Graphics.Graphviz.NodeID(\"\\\"J:inf\\\"\", \"\", \"\")], OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:label => \"1\", :labelfontsize => \"6\")), Catlab.Graphics.Graphviz.Edge(Catlab.Graphics.Graphviz.NodeID[Catlab.Graphics.Graphviz.NodeID(\"\\\"J:S\\\"\", \"\", \"\"), Catlab.Graphics.Graphviz.NodeID(\"\\\"J:inf\\\"\", \"\", \"\")], OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:label => \"1\", :labelfontsize => \"6\")), Catlab.Graphics.Graphviz.Edge(Catlab.Graphics.Graphviz.NodeID[Catlab.Graphics.Graphviz.NodeID(\"\\\"J:inf\\\"\", \"\", \"\"), Catlab.Graphics.Graphviz.NodeID(\"\\\"J:I\\\"\", \"\", \"\")], OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:label => \"2\", :labelfontsize => \"6\")), Catlab.Graphics.Graphviz.Edge(Catlab.Graphics.Graphviz.NodeID[Catlab.Graphics.Graphviz.NodeID(\"\\\"J:I\\\"\", \"\", \"\"), Catlab.Graphics.Graphviz.NodeID(\"\\\"J:rec\\\"\", \"\", \"\")], OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:label => \"1\", :labelfontsize => \"6\")), Catlab.Graphics.Graphviz.Edge(Catlab.Graphics.Graphviz.NodeID[Catlab.Graphics.Graphviz.NodeID(\"\\\"J:rec\\\"\", \"\", \"\"), Catlab.Graphics.Graphviz.NodeID(\"\\\"J:R\\\"\", \"\", \"\")], OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:label => \"1\", :labelfontsize => \"6\"))], OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:rankdir => \"LR\"), OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:shape => \"plain\", :style => \"filled\", :color => \"white\"), OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:splines => \"splines\"))"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Original Model\n",
"Graph(sir)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
"<!-- Generated by graphviz version 2.47.3 (20210619.1520)\n",
" -->\n",
"<!-- Title: G Pages: 1 -->\n",
"<svg width=\"218pt\" height=\"52pt\"\n",
" viewBox=\"0.00 0.00 218.19 52.20\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 48.2)\">\n",
"<title>G</title>\n",
"<polygon fill=\"white\" stroke=\"transparent\" points=\"-4,4 -4,-48.2 214.19,-48.2 214.19,4 -4,4\"/>\n",
"<!-- J:S -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>J:S</title>\n",
"<ellipse fill=\"#6c9ac3\" stroke=\"#6c9ac3\" cx=\"22.1\" cy=\"-22.1\" rx=\"22.2\" ry=\"22.2\"/>\n",
"<text text-anchor=\"middle\" x=\"22.1\" y=\"-18.4\" font-family=\"Times,serif\" font-size=\"14.00\">J:S</text>\n",
"</g>\n",
"<!-- J:inf -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>J:inf</title>\n",
"<polygon fill=\"#e28f41\" stroke=\"#e28f41\" points=\"128.2,-42.6 87.2,-42.6 87.2,-1.6 128.2,-1.6 128.2,-42.6\"/>\n",
"<text text-anchor=\"middle\" x=\"107.7\" y=\"-18.4\" font-family=\"Times,serif\" font-size=\"14.00\">J:inf</text>\n",
"</g>\n",
"<!-- J:S&#45;&gt;J:inf -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>J:S&#45;&gt;J:inf</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M44.63,-22.1C54.42,-22.1 66.18,-22.1 76.81,-22.1\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"76.96,-25.6 86.96,-22.1 76.96,-18.6 76.96,-25.6\"/>\n",
"<text text-anchor=\"middle\" x=\"65.7\" y=\"-25.9\" font-family=\"Times,serif\" font-size=\"14.00\">1</text>\n",
"</g>\n",
"<!-- J:I -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>J:I</title>\n",
"<ellipse fill=\"#6c9ac3\" stroke=\"#6c9ac3\" cx=\"190.69\" cy=\"-22.1\" rx=\"19.5\" ry=\"19.5\"/>\n",
"<text text-anchor=\"middle\" x=\"190.69\" y=\"-18.4\" font-family=\"Times,serif\" font-size=\"14.00\">J:I</text>\n",
"</g>\n",
"<!-- J:I&#45;&gt;J:inf -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>J:I&#45;&gt;J:inf</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M173.58,-12.17C167.43,-8.92 160.21,-5.73 153.2,-4.1 148.05,-2.9 142.73,-3.4 137.63,-4.82\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"136.24,-1.61 128.2,-8.51 138.79,-8.13 136.24,-1.61\"/>\n",
"<text text-anchor=\"middle\" x=\"149.7\" y=\"-7.9\" font-family=\"Times,serif\" font-size=\"14.00\">1</text>\n",
"</g>\n",
"<!-- J:inf&#45;&gt;J:I -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>J:inf&#45;&gt;J:I</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M128.3,-22.1C138.07,-22.1 150.06,-22.1 160.84,-22.1\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"161.1,-25.6 171.1,-22.1 161.1,-18.6 161.1,-25.6\"/>\n",
"<text text-anchor=\"middle\" x=\"149.7\" y=\"-25.9\" font-family=\"Times,serif\" font-size=\"14.00\">2</text>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"Graph(\"G\", true, \"dot\", Catlab.Graphics.Graphviz.Statement[Catlab.Graphics.Graphviz.Node(\"\\\"J:S\\\"\", OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:shape => \"circle\", :color => \"#6C9AC3\")), Catlab.Graphics.Graphviz.Node(\"\\\"J:I\\\"\", OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:shape => \"circle\", :color => \"#6C9AC3\")), Catlab.Graphics.Graphviz.Node(\"\\\"J:inf\\\"\", OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:shape => \"square\", :color => \"#E28F41\")), Catlab.Graphics.Graphviz.Edge(Catlab.Graphics.Graphviz.NodeID[Catlab.Graphics.Graphviz.NodeID(\"\\\"J:I\\\"\", \"\", \"\"), Catlab.Graphics.Graphviz.NodeID(\"\\\"J:inf\\\"\", \"\", \"\")], OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:label => \"1\", :labelfontsize => \"6\")), Catlab.Graphics.Graphviz.Edge(Catlab.Graphics.Graphviz.NodeID[Catlab.Graphics.Graphviz.NodeID(\"\\\"J:S\\\"\", \"\", \"\"), Catlab.Graphics.Graphviz.NodeID(\"\\\"J:inf\\\"\", \"\", \"\")], OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:label => \"1\", :labelfontsize => \"6\")), Catlab.Graphics.Graphviz.Edge(Catlab.Graphics.Graphviz.NodeID[Catlab.Graphics.Graphviz.NodeID(\"\\\"J:inf\\\"\", \"\", \"\"), Catlab.Graphics.Graphviz.NodeID(\"\\\"J:I\\\"\", \"\", \"\")], OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:label => \"2\", :labelfontsize => \"6\"))], OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:rankdir => \"LR\"), OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:shape => \"plain\", :style => \"filled\", :color => \"white\"), OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:splines => \"splines\"))"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Infection process we want to replace\n",
"Graph(inf)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
"<!-- Generated by graphviz version 2.47.3 (20210619.1520)\n",
" -->\n",
"<!-- Title: G Pages: 1 -->\n",
"<svg width=\"396pt\" height=\"120pt\"\n",
" viewBox=\"0.00 0.00 396.39 120.10\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 116.1)\">\n",
"<title>G</title>\n",
"<polygon fill=\"white\" stroke=\"transparent\" points=\"-4,4 -4,-116.1 392.39,-116.1 392.39,4 -4,4\"/>\n",
"<!-- J:S -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>J:S</title>\n",
"<ellipse fill=\"#6c9ac3\" stroke=\"#6c9ac3\" cx=\"22.1\" cy=\"-72.1\" rx=\"22.2\" ry=\"22.2\"/>\n",
"<text text-anchor=\"middle\" x=\"22.1\" y=\"-68.4\" font-family=\"Times,serif\" font-size=\"14.00\">J:S</text>\n",
"</g>\n",
"<!-- J:exp -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>J:exp</title>\n",
"<polygon fill=\"#e28f41\" stroke=\"#e28f41\" points=\"133.2,-95.1 87.2,-95.1 87.2,-49.1 133.2,-49.1 133.2,-95.1\"/>\n",
"<text text-anchor=\"middle\" x=\"110.2\" y=\"-68.4\" font-family=\"Times,serif\" font-size=\"14.00\">J:exp</text>\n",
"</g>\n",
"<!-- J:S&#45;&gt;J:exp -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>J:S&#45;&gt;J:exp</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M44.38,-72.1C54.19,-72.1 66.05,-72.1 76.93,-72.1\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"76.96,-75.6 86.96,-72.1 76.96,-68.6 76.96,-75.6\"/>\n",
"<text text-anchor=\"middle\" x=\"65.7\" y=\"-75.9\" font-family=\"Times,serif\" font-size=\"14.00\">1</text>\n",
"</g>\n",
"<!-- J:I -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>J:I</title>\n",
"<ellipse fill=\"#6c9ac3\" stroke=\"#6c9ac3\" cx=\"368.89\" cy=\"-72.1\" rx=\"19.5\" ry=\"19.5\"/>\n",
"<text text-anchor=\"middle\" x=\"368.89\" y=\"-68.4\" font-family=\"Times,serif\" font-size=\"14.00\">J:I</text>\n",
"</g>\n",
"<!-- J:I&#45;&gt;J:exp -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>J:I&#45;&gt;J:exp</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M349.31,-72.1C306.04,-72.1 198.1,-72.1 143.66,-72.1\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"143.53,-68.6 133.53,-72.1 143.53,-75.6 143.53,-68.6\"/>\n",
"<text text-anchor=\"middle\" x=\"241.89\" y=\"-75.9\" font-family=\"Times,serif\" font-size=\"14.00\">1</text>\n",
"</g>\n",
"<!-- J:E -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>J:E</title>\n",
"<ellipse fill=\"#6c9ac3\" stroke=\"#6c9ac3\" cx=\"198.29\" cy=\"-22.1\" rx=\"22.2\" ry=\"22.2\"/>\n",
"<text text-anchor=\"middle\" x=\"198.29\" y=\"-18.4\" font-family=\"Times,serif\" font-size=\"14.00\">J:E</text>\n",
"</g>\n",
"<!-- J:inc -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>J:inc</title>\n",
"<polygon fill=\"#e28f41\" stroke=\"#e28f41\" points=\"306.39,-43.6 263.39,-43.6 263.39,-0.6 306.39,-0.6 306.39,-43.6\"/>\n",
"<text text-anchor=\"middle\" x=\"284.89\" y=\"-18.4\" font-family=\"Times,serif\" font-size=\"14.00\">J:inc</text>\n",
"</g>\n",
"<!-- J:E&#45;&gt;J:inc -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>J:E&#45;&gt;J:inc</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M220.64,-22.1C230.41,-22.1 242.17,-22.1 252.88,-22.1\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"253.14,-25.6 263.14,-22.1 253.14,-18.6 253.14,-25.6\"/>\n",
"<text text-anchor=\"middle\" x=\"241.89\" y=\"-25.9\" font-family=\"Times,serif\" font-size=\"14.00\">1</text>\n",
"</g>\n",
"<!-- J:exp&#45;&gt;J:I -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>J:exp&#45;&gt;J:I</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M133.29,-81.21C139.02,-83.19 145.26,-85.02 151.2,-86.1 229.99,-100.42 252.82,-101.6 331.39,-86.1 334.65,-85.45 338.01,-84.54 341.29,-83.49\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"342.59,-86.74 350.8,-80.04 340.21,-80.16 342.59,-86.74\"/>\n",
"<text text-anchor=\"middle\" x=\"241.89\" y=\"-100.9\" font-family=\"Times,serif\" font-size=\"14.00\">1</text>\n",
"</g>\n",
"<!-- J:exp&#45;&gt;J:E -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>J:exp&#45;&gt;J:E</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M133.51,-54.72C139.14,-50.68 145.27,-46.55 151.2,-43.1 156.55,-39.98 162.45,-36.99 168.19,-34.29\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"169.9,-37.35 177.57,-30.05 167.02,-30.97 169.9,-37.35\"/>\n",
"<text text-anchor=\"middle\" x=\"154.7\" y=\"-46.9\" font-family=\"Times,serif\" font-size=\"14.00\">1</text>\n",
"</g>\n",
"<!-- J:inc&#45;&gt;J:I -->\n",
"<g id=\"edge6\" class=\"edge\">\n",
"<title>J:inc&#45;&gt;J:I</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M306.82,-30.5C314.73,-34 323.69,-38.35 331.39,-43.1 336.22,-46.07 341.13,-49.58 345.73,-53.12\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"343.57,-55.88 353.56,-59.4 347.95,-50.42 343.57,-55.88\"/>\n",
"<text text-anchor=\"middle\" x=\"327.89\" y=\"-46.9\" font-family=\"Times,serif\" font-size=\"14.00\">1</text>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"Graph(\"G\", true, \"dot\", Catlab.Graphics.Graphviz.Statement[Catlab.Graphics.Graphviz.Node(\"\\\"J:S\\\"\", OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:shape => \"circle\", :color => \"#6C9AC3\")), Catlab.Graphics.Graphviz.Node(\"\\\"J:I\\\"\", OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:shape => \"circle\", :color => \"#6C9AC3\")), Catlab.Graphics.Graphviz.Node(\"\\\"J:E\\\"\", OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:shape => \"circle\", :color => \"#6C9AC3\")), Catlab.Graphics.Graphviz.Node(\"\\\"J:exp\\\"\", OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:shape => \"square\", :color => \"#E28F41\")), Catlab.Graphics.Graphviz.Node(\"\\\"J:inc\\\"\", OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:shape => \"square\", :color => \"#E28F41\")), Catlab.Graphics.Graphviz.Edge(Catlab.Graphics.Graphviz.NodeID[Catlab.Graphics.Graphviz.NodeID(\"\\\"J:I\\\"\", \"\", \"\"), Catlab.Graphics.Graphviz.NodeID(\"\\\"J:exp\\\"\", \"\", \"\")], OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:label => \"1\", :labelfontsize => \"6\")), Catlab.Graphics.Graphviz.Edge(Catlab.Graphics.Graphviz.NodeID[Catlab.Graphics.Graphviz.NodeID(\"\\\"J:S\\\"\", \"\", \"\"), Catlab.Graphics.Graphviz.NodeID(\"\\\"J:exp\\\"\", \"\", \"\")], OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:label => \"1\", :labelfontsize => \"6\")), Catlab.Graphics.Graphviz.Edge(Catlab.Graphics.Graphviz.NodeID[Catlab.Graphics.Graphviz.NodeID(\"\\\"J:exp\\\"\", \"\", \"\"), Catlab.Graphics.Graphviz.NodeID(\"\\\"J:I\\\"\", \"\", \"\")], OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:label => \"1\", :labelfontsize => \"6\")), Catlab.Graphics.Graphviz.Edge(Catlab.Graphics.Graphviz.NodeID[Catlab.Graphics.Graphviz.NodeID(\"\\\"J:exp\\\"\", \"\", \"\"), Catlab.Graphics.Graphviz.NodeID(\"\\\"J:E\\\"\", \"\", \"\")], OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:label => \"1\", :labelfontsize => \"6\")), Catlab.Graphics.Graphviz.Edge(Catlab.Graphics.Graphviz.NodeID[Catlab.Graphics.Graphviz.NodeID(\"\\\"J:E\\\"\", \"\", \"\"), Catlab.Graphics.Graphviz.NodeID(\"\\\"J:inc\\\"\", \"\", \"\")], OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:label => \"1\", :labelfontsize => \"6\")), Catlab.Graphics.Graphviz.Edge(Catlab.Graphics.Graphviz.NodeID[Catlab.Graphics.Graphviz.NodeID(\"\\\"J:inc\\\"\", \"\", \"\"), Catlab.Graphics.Graphviz.NodeID(\"\\\"J:I\\\"\", \"\", \"\")], OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:label => \"1\", :labelfontsize => \"6\"))], OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:rankdir => \"LR\"), OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:shape => \"plain\", :style => \"filled\", :color => \"white\"), OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:splines => \"splines\"))"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Exposure process we want to insert\n",
"Graph(exposure)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
"<!-- Generated by graphviz version 2.47.3 (20210619.1520)\n",
" -->\n",
"<!-- Title: G Pages: 1 -->\n",
"<svg width=\"571pt\" height=\"120pt\"\n",
" viewBox=\"0.00 0.00 570.88 120.10\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 116.1)\">\n",
"<title>G</title>\n",
"<polygon fill=\"white\" stroke=\"transparent\" points=\"-4,4 -4,-116.1 566.88,-116.1 566.88,4 -4,4\"/>\n",
"<!-- J:S -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>J:S</title>\n",
"<ellipse fill=\"#6c9ac3\" stroke=\"#6c9ac3\" cx=\"22.1\" cy=\"-72.1\" rx=\"22.2\" ry=\"22.2\"/>\n",
"<text text-anchor=\"middle\" x=\"22.1\" y=\"-68.4\" font-family=\"Times,serif\" font-size=\"14.00\">J:S</text>\n",
"</g>\n",
"<!-- J:exp -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>J:exp</title>\n",
"<polygon fill=\"#e28f41\" stroke=\"#e28f41\" points=\"133.2,-95.1 87.2,-95.1 87.2,-49.1 133.2,-49.1 133.2,-95.1\"/>\n",
"<text text-anchor=\"middle\" x=\"110.2\" y=\"-68.4\" font-family=\"Times,serif\" font-size=\"14.00\">J:exp</text>\n",
"</g>\n",
"<!-- J:S&#45;&gt;J:exp -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>J:S&#45;&gt;J:exp</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M44.38,-72.1C54.19,-72.1 66.05,-72.1 76.93,-72.1\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"76.96,-75.6 86.96,-72.1 76.96,-68.6 76.96,-75.6\"/>\n",
"<text text-anchor=\"middle\" x=\"65.7\" y=\"-75.9\" font-family=\"Times,serif\" font-size=\"14.00\">1</text>\n",
"</g>\n",
"<!-- J:I -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>J:I</title>\n",
"<ellipse fill=\"#6c9ac3\" stroke=\"#6c9ac3\" cx=\"368.89\" cy=\"-72.1\" rx=\"19.5\" ry=\"19.5\"/>\n",
"<text text-anchor=\"middle\" x=\"368.89\" y=\"-68.4\" font-family=\"Times,serif\" font-size=\"14.00\">J:I</text>\n",
"</g>\n",
"<!-- J:I&#45;&gt;J:exp -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>J:I&#45;&gt;J:exp</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M349.31,-72.1C306.04,-72.1 198.1,-72.1 143.66,-72.1\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"143.53,-68.6 133.53,-72.1 143.53,-75.6 143.53,-68.6\"/>\n",
"<text text-anchor=\"middle\" x=\"241.89\" y=\"-75.9\" font-family=\"Times,serif\" font-size=\"14.00\">1</text>\n",
"</g>\n",
"<!-- J:rec -->\n",
"<g id=\"node7\" class=\"node\">\n",
"<title>J:rec</title>\n",
"<polygon fill=\"#e28f41\" stroke=\"#e28f41\" points=\"474.39,-93.6 431.39,-93.6 431.39,-50.6 474.39,-50.6 474.39,-93.6\"/>\n",
"<text text-anchor=\"middle\" x=\"452.89\" y=\"-68.4\" font-family=\"Times,serif\" font-size=\"14.00\">J:rec</text>\n",
"</g>\n",
"<!-- J:I&#45;&gt;J:rec -->\n",
"<g id=\"edge7\" class=\"edge\">\n",
"<title>J:I&#45;&gt;J:rec</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M388.5,-72.1C398.17,-72.1 410.23,-72.1 421.23,-72.1\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"421.34,-75.6 431.34,-72.1 421.34,-68.6 421.34,-75.6\"/>\n",
"<text text-anchor=\"middle\" x=\"409.89\" y=\"-75.9\" font-family=\"Times,serif\" font-size=\"14.00\">1</text>\n",
"</g>\n",
"<!-- J:E -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>J:E</title>\n",
"<ellipse fill=\"#6c9ac3\" stroke=\"#6c9ac3\" cx=\"198.29\" cy=\"-22.1\" rx=\"22.2\" ry=\"22.2\"/>\n",
"<text text-anchor=\"middle\" x=\"198.29\" y=\"-18.4\" font-family=\"Times,serif\" font-size=\"14.00\">J:E</text>\n",
"</g>\n",
"<!-- J:inc -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>J:inc</title>\n",
"<polygon fill=\"#e28f41\" stroke=\"#e28f41\" points=\"306.39,-43.6 263.39,-43.6 263.39,-0.6 306.39,-0.6 306.39,-43.6\"/>\n",
"<text text-anchor=\"middle\" x=\"284.89\" y=\"-18.4\" font-family=\"Times,serif\" font-size=\"14.00\">J:inc</text>\n",
"</g>\n",
"<!-- J:E&#45;&gt;J:inc -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>J:E&#45;&gt;J:inc</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M220.64,-22.1C230.41,-22.1 242.17,-22.1 252.88,-22.1\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"253.14,-25.6 263.14,-22.1 253.14,-18.6 253.14,-25.6\"/>\n",
"<text text-anchor=\"middle\" x=\"241.89\" y=\"-25.9\" font-family=\"Times,serif\" font-size=\"14.00\">1</text>\n",
"</g>\n",
"<!-- J:R -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>J:R</title>\n",
"<ellipse fill=\"#6c9ac3\" stroke=\"#6c9ac3\" cx=\"540.14\" cy=\"-72.1\" rx=\"23\" ry=\"23\"/>\n",
"<text text-anchor=\"middle\" x=\"540.14\" y=\"-68.4\" font-family=\"Times,serif\" font-size=\"14.00\">J:R</text>\n",
"</g>\n",
"<!-- J:exp&#45;&gt;J:I -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>J:exp&#45;&gt;J:I</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M133.29,-81.21C139.02,-83.19 145.26,-85.02 151.2,-86.1 229.99,-100.42 252.82,-101.6 331.39,-86.1 334.65,-85.45 338.01,-84.54 341.29,-83.49\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"342.59,-86.74 350.8,-80.04 340.21,-80.16 342.59,-86.74\"/>\n",
"<text text-anchor=\"middle\" x=\"241.89\" y=\"-100.9\" font-family=\"Times,serif\" font-size=\"14.00\">1</text>\n",
"</g>\n",
"<!-- J:exp&#45;&gt;J:E -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>J:exp&#45;&gt;J:E</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M133.51,-54.72C139.14,-50.68 145.27,-46.55 151.2,-43.1 156.55,-39.98 162.45,-36.99 168.19,-34.29\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"169.9,-37.35 177.57,-30.05 167.02,-30.97 169.9,-37.35\"/>\n",
"<text text-anchor=\"middle\" x=\"154.7\" y=\"-46.9\" font-family=\"Times,serif\" font-size=\"14.00\">1</text>\n",
"</g>\n",
"<!-- J:inc&#45;&gt;J:I -->\n",
"<g id=\"edge6\" class=\"edge\">\n",
"<title>J:inc&#45;&gt;J:I</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M306.82,-30.5C314.73,-34 323.69,-38.35 331.39,-43.1 336.22,-46.07 341.13,-49.58 345.73,-53.12\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"343.57,-55.88 353.56,-59.4 347.95,-50.42 343.57,-55.88\"/>\n",
"<text text-anchor=\"middle\" x=\"327.89\" y=\"-46.9\" font-family=\"Times,serif\" font-size=\"14.00\">1</text>\n",
"</g>\n",
"<!-- J:rec&#45;&gt;J:R -->\n",
"<g id=\"edge8\" class=\"edge\">\n",
"<title>J:rec&#45;&gt;J:R</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M474.52,-72.1C484.31,-72.1 496.22,-72.1 507.14,-72.1\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"507.2,-75.6 517.2,-72.1 507.2,-68.6 507.2,-75.6\"/>\n",
"<text text-anchor=\"middle\" x=\"495.89\" y=\"-75.9\" font-family=\"Times,serif\" font-size=\"14.00\">1</text>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"Graph(\"G\", true, \"dot\", Catlab.Graphics.Graphviz.Statement[Catlab.Graphics.Graphviz.Node(\"\\\"J:S\\\"\", OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:shape => \"circle\", :color => \"#6C9AC3\")), Catlab.Graphics.Graphviz.Node(\"\\\"J:I\\\"\", OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:shape => \"circle\", :color => \"#6C9AC3\")), Catlab.Graphics.Graphviz.Node(\"\\\"J:E\\\"\", OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:shape => \"circle\", :color => \"#6C9AC3\")), Catlab.Graphics.Graphviz.Node(\"\\\"J:R\\\"\", OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:shape => \"circle\", :color => \"#6C9AC3\")), Catlab.Graphics.Graphviz.Node(\"\\\"J:exp\\\"\", OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:shape => \"square\", :color => \"#E28F41\")), Catlab.Graphics.Graphviz.Node(\"\\\"J:inc\\\"\", OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:shape => \"square\", :color => \"#E28F41\")), Catlab.Graphics.Graphviz.Node(\"\\\"J:rec\\\"\", OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:shape => \"square\", :color => \"#E28F41\")), Catlab.Graphics.Graphviz.Edge(Catlab.Graphics.Graphviz.NodeID[Catlab.Graphics.Graphviz.NodeID(\"\\\"J:I\\\"\", \"\", \"\"), Catlab.Graphics.Graphviz.NodeID(\"\\\"J:exp\\\"\", \"\", \"\")], OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:label => \"1\", :labelfontsize => \"6\")), Catlab.Graphics.Graphviz.Edge(Catlab.Graphics.Graphviz.NodeID[Catlab.Graphics.Graphviz.NodeID(\"\\\"J:S\\\"\", \"\", \"\"), Catlab.Graphics.Graphviz.NodeID(\"\\\"J:exp\\\"\", \"\", \"\")], OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:label => \"1\", :labelfontsize => \"6\")), Catlab.Graphics.Graphviz.Edge(Catlab.Graphics.Graphviz.NodeID[Catlab.Graphics.Graphviz.NodeID(\"\\\"J:exp\\\"\", \"\", \"\"), Catlab.Graphics.Graphviz.NodeID(\"\\\"J:I\\\"\", \"\", \"\")], OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:label => \"1\", :labelfontsize => \"6\")), Catlab.Graphics.Graphviz.Edge(Catlab.Graphics.Graphviz.NodeID[Catlab.Graphics.Graphviz.NodeID(\"\\\"J:exp\\\"\", \"\", \"\"), Catlab.Graphics.Graphviz.NodeID(\"\\\"J:E\\\"\", \"\", \"\")], OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:label => \"1\", :labelfontsize => \"6\")), Catlab.Graphics.Graphviz.Edge(Catlab.Graphics.Graphviz.NodeID[Catlab.Graphics.Graphviz.NodeID(\"\\\"J:E\\\"\", \"\", \"\"), Catlab.Graphics.Graphviz.NodeID(\"\\\"J:inc\\\"\", \"\", \"\")], OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:label => \"1\", :labelfontsize => \"6\")), Catlab.Graphics.Graphviz.Edge(Catlab.Graphics.Graphviz.NodeID[Catlab.Graphics.Graphviz.NodeID(\"\\\"J:inc\\\"\", \"\", \"\"), Catlab.Graphics.Graphviz.NodeID(\"\\\"J:I\\\"\", \"\", \"\")], OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:label => \"1\", :labelfontsize => \"6\")), Catlab.Graphics.Graphviz.Edge(Catlab.Graphics.Graphviz.NodeID[Catlab.Graphics.Graphviz.NodeID(\"\\\"J:I\\\"\", \"\", \"\"), Catlab.Graphics.Graphviz.NodeID(\"\\\"J:rec\\\"\", \"\", \"\")], OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:label => \"1\", :labelfontsize => \"6\")), Catlab.Graphics.Graphviz.Edge(Catlab.Graphics.Graphviz.NodeID[Catlab.Graphics.Graphviz.NodeID(\"\\\"J:rec\\\"\", \"\", \"\"), Catlab.Graphics.Graphviz.NodeID(\"\\\"J:R\\\"\", \"\", \"\")], OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:label => \"1\", :labelfontsize => \"6\"))], OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:rankdir => \"LR\"), OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:shape => \"plain\", :style => \"filled\", :color => \"white\"), OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:splines => \"splines\"))"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Insertion process\n",
"seir = PetriMutations.rewrite(sir, inf, exposure)\n",
"Graph(seir)"
]
}
],
"metadata": {
"@webio": {
"lastCommId": null,
"lastKernelId": null
},
"kernelspec": {
"display_name": "Julia 1.6.1",
"language": "julia",
"name": "julia-1.6"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.6.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment