get rid of outdated examples
This commit is contained in:
parent
4ba0ed09b2
commit
0b936a48d1
8 changed files with 15 additions and 473 deletions
|
|
@ -1,75 +0,0 @@
|
||||||
from state.devstate import DevState
|
|
||||||
from bootstrap.scd import bootstrap_scd
|
|
||||||
from framework.conformance import Conformance, render_conformance_check_result
|
|
||||||
from concrete_syntax.textual_od import parser, renderer
|
|
||||||
from concrete_syntax.common import indent
|
|
||||||
from concrete_syntax.plantuml import renderer as plantuml
|
|
||||||
from util.prompt import yes_no, pause
|
|
||||||
|
|
||||||
state = DevState()
|
|
||||||
scd_mmm = bootstrap_scd(state)
|
|
||||||
|
|
||||||
|
|
||||||
mm_cs = """
|
|
||||||
BaseA:Class {
|
|
||||||
abstract = True;
|
|
||||||
}
|
|
||||||
BaseB:Class {
|
|
||||||
abstract = True;
|
|
||||||
}
|
|
||||||
baseAssoc:Association (BaseA -> BaseB) {
|
|
||||||
abstract = True;
|
|
||||||
target_lower_cardinality = 1;
|
|
||||||
target_upper_cardinality = 2; # A has 1..2 B
|
|
||||||
}
|
|
||||||
A:Class
|
|
||||||
B:Class
|
|
||||||
assoc:Association (A -> B) {
|
|
||||||
# we can further restrict cardinality from baseAssoc:
|
|
||||||
target_upper_cardinality = 1;
|
|
||||||
|
|
||||||
# relaxing cardinalities or constraints can be done (meaning: it will still be a valid meta-model), but will have no effect: for any instance of a type, the constraints defined on the type and its supertypes will be checked.
|
|
||||||
}
|
|
||||||
:Inheritance (A -> BaseA)
|
|
||||||
:Inheritance (B -> BaseB)
|
|
||||||
:Inheritance (assoc -> baseAssoc)
|
|
||||||
"""
|
|
||||||
|
|
||||||
print()
|
|
||||||
print("Parsing meta-model...")
|
|
||||||
mm = parser.parse_od(
|
|
||||||
state,
|
|
||||||
m_text=mm_cs, # the string of text to parse
|
|
||||||
mm=scd_mmm, # the meta-model of class diagrams (= our meta-meta-model)
|
|
||||||
)
|
|
||||||
print("OK")
|
|
||||||
|
|
||||||
print("Is our meta-model a valid class diagram?")
|
|
||||||
conf = Conformance(state, mm, scd_mmm)
|
|
||||||
print(render_conformance_check_result(conf.check_nominal()))
|
|
||||||
|
|
||||||
m_cs = """
|
|
||||||
a0:A
|
|
||||||
b0:B
|
|
||||||
b1:B
|
|
||||||
|
|
||||||
# error: assoc (A -> B) must have tgt card 0..1 (and we have 2 instead)
|
|
||||||
:assoc (a0 -> b0)
|
|
||||||
:assoc (a0 -> b1)
|
|
||||||
|
|
||||||
# error: baseAssoc (A -> B) must have tgt card 1..2 (and we have 0 instead)
|
|
||||||
a1:A
|
|
||||||
"""
|
|
||||||
|
|
||||||
print()
|
|
||||||
print("Parsing model...")
|
|
||||||
m = parser.parse_od(
|
|
||||||
state,
|
|
||||||
m_text=m_cs,
|
|
||||||
mm=mm, # this time, the meta-model is the previous model we parsed
|
|
||||||
)
|
|
||||||
print("OK")
|
|
||||||
|
|
||||||
print("Is our model a valid woods-diagram?")
|
|
||||||
conf = Conformance(state, m, mm)
|
|
||||||
print(render_conformance_check_result(conf.check_nominal()))
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
from state.devstate import DevState
|
|
||||||
from bootstrap.scd import bootstrap_scd
|
|
||||||
from services.scd import SCD
|
|
||||||
from concrete_syntax.plantuml import renderer as plantuml
|
|
||||||
|
|
||||||
def main():
|
|
||||||
state = DevState()
|
|
||||||
root = state.read_root() # id: 0
|
|
||||||
|
|
||||||
scd_mm_id = bootstrap_scd(state)
|
|
||||||
|
|
||||||
uml = ""
|
|
||||||
|
|
||||||
# Render SCD Meta-Model as Object Diagram
|
|
||||||
uml += plantuml.render_package("Object Diagram", plantuml.render_object_diagram(state, scd_mm_id, scd_mm_id, prefix_ids="od_"))
|
|
||||||
|
|
||||||
# Render SCD Meta-Model as Class Diagram
|
|
||||||
uml += plantuml.render_package("Class Diagram", plantuml.render_class_diagram(state, scd_mm_id, prefix_ids="cd_"))
|
|
||||||
|
|
||||||
# Render conformance
|
|
||||||
uml += plantuml.render_trace_conformance(state, scd_mm_id, scd_mm_id, prefix_inst_ids="od_", prefix_type_ids="cd_")
|
|
||||||
|
|
||||||
print(uml)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
||||||
|
|
@ -1,200 +0,0 @@
|
||||||
from state.devstate import DevState
|
|
||||||
from bootstrap.scd import bootstrap_scd
|
|
||||||
from framework.conformance import Conformance, render_conformance_check_result
|
|
||||||
from concrete_syntax.textual_od import parser, renderer
|
|
||||||
from concrete_syntax.common import indent
|
|
||||||
from concrete_syntax.plantuml import renderer as plantuml
|
|
||||||
from concrete_syntax.plantuml.make_url import make_url
|
|
||||||
from util.prompt import yes_no, pause
|
|
||||||
|
|
||||||
state = DevState()
|
|
||||||
|
|
||||||
print("Loading meta-meta-model...")
|
|
||||||
scd_mmm = bootstrap_scd(state)
|
|
||||||
print("OK")
|
|
||||||
|
|
||||||
print("Is our meta-meta-model a valid class diagram?")
|
|
||||||
conf = Conformance(state, scd_mmm, scd_mmm)
|
|
||||||
print(render_conformance_check_result(conf.check_nominal()))
|
|
||||||
|
|
||||||
# If you are curious, you can serialize the meta-meta-model:
|
|
||||||
# print("--------------")
|
|
||||||
# print(indent(
|
|
||||||
# renderer.render_od(state,
|
|
||||||
# m_id=scd_mmm,
|
|
||||||
# mm_id=scd_mmm),
|
|
||||||
# 4))
|
|
||||||
# print("--------------")
|
|
||||||
|
|
||||||
|
|
||||||
# Change this:
|
|
||||||
woods_mm_cs = """
|
|
||||||
Animal:Class {
|
|
||||||
# The class Animal is an abstract class:
|
|
||||||
abstract = True;
|
|
||||||
}
|
|
||||||
|
|
||||||
# A class without attributes
|
|
||||||
# The `abstract` attribute shown above is optional (default: False)
|
|
||||||
Bear:Class
|
|
||||||
|
|
||||||
# Inheritance between two Classes is expressed as follows:
|
|
||||||
:Inheritance (Bear -> Animal) # meaning: Bear is an Animal
|
|
||||||
|
|
||||||
Man:Class {
|
|
||||||
# We can define lower and upper cardinalities on Classes
|
|
||||||
# (if unspecified, the lower-card is 0, and upper-card is infinity)
|
|
||||||
|
|
||||||
lower_cardinality = 1; # there must be at least one Man in every model
|
|
||||||
upper_cardinality = 2; # there must be at most two Men in every model
|
|
||||||
|
|
||||||
constraint = ```
|
|
||||||
# Python code
|
|
||||||
# the last statement must be a boolean expression
|
|
||||||
|
|
||||||
# When conformance checking, this code will be run for every Man-object.
|
|
||||||
# The variable 'this' refers to the current Man-object.
|
|
||||||
|
|
||||||
# Every man weighs at least '20'
|
|
||||||
# (the attribute 'weight' is added further down)
|
|
||||||
get_value(get_slot(this, "weight")) > 20
|
|
||||||
```;
|
|
||||||
}
|
|
||||||
# Note that we can only declare the inheritance link after having declared both Man and Animal: We can only refer to earlier objects
|
|
||||||
:Inheritance (Man -> Animal) # Man is also an Animal
|
|
||||||
|
|
||||||
|
|
||||||
# BTW, we could also give the Inheritance-link a name, for instance:
|
|
||||||
# man_is_animal:Inheritance (Man -> Animal)
|
|
||||||
#
|
|
||||||
# Likewise, Classes, Associations, ... can also be nameless, for instance:
|
|
||||||
# :Class { ... }
|
|
||||||
# :Association (Man -> Man) { ... }
|
|
||||||
# However, we typically want to give names to classes and associations, because we want to refer to them later.
|
|
||||||
|
|
||||||
|
|
||||||
# We now add an attribute to 'Man'
|
|
||||||
# Attributes are not that different from Associations: both are represented by links
|
|
||||||
Man_weight:AttributeLink (Man -> Integer) {
|
|
||||||
name = "weight"; # mandatory!
|
|
||||||
optional = False; # <- meaning: every Man *must* have a weight
|
|
||||||
|
|
||||||
# We can also define constraints on attributes
|
|
||||||
constraint = ```
|
|
||||||
# Python code
|
|
||||||
# Here, 'this' refers to the LINK that connects a Man-object to an Integer
|
|
||||||
tgt = get_target(this) # <- we get the target of the LINK (an Integer-object)
|
|
||||||
weight = get_value(tgt) # <- get the Integer-value (e.g., 80)
|
|
||||||
weight > 20
|
|
||||||
```;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create an Association from Man to Animal
|
|
||||||
afraidOf:Association (Man -> Animal) {
|
|
||||||
# An association has the following (optional) attributes:
|
|
||||||
# - source_lower_cardinality (default: 0)
|
|
||||||
# - source_upper_cardinality (default: infinity)
|
|
||||||
# - target_lower_cardinality (default: 0)
|
|
||||||
# - target_upper_cardinality (default: infinity)
|
|
||||||
|
|
||||||
# Every Man is afraid of at least one Animal:
|
|
||||||
target_lower_cardinality = 1;
|
|
||||||
|
|
||||||
# No more than 6 Men are afraid of the same Animal:
|
|
||||||
source_upper_cardinality = 6;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create a GlobalConstraint
|
|
||||||
total_weight_small_enough:GlobalConstraint {
|
|
||||||
# Note: for GlobalConstraints, there is no 'this'-variable
|
|
||||||
constraint = ```
|
|
||||||
# Python code
|
|
||||||
# compute sum of all weights
|
|
||||||
total_weight = 0
|
|
||||||
for man_name, man_id in get_all_instances("Man"):
|
|
||||||
total_weight += get_value(get_slot(man_id, "weight"))
|
|
||||||
|
|
||||||
# as usual, the last statement is a boolean expression that we think should be satisfied
|
|
||||||
total_weight < 85
|
|
||||||
```;
|
|
||||||
}
|
|
||||||
"""
|
|
||||||
|
|
||||||
print()
|
|
||||||
print("Parsing 'woods' meta-model...")
|
|
||||||
woods_mm = parser.parse_od(
|
|
||||||
state,
|
|
||||||
m_text=woods_mm_cs, # the string of text to parse
|
|
||||||
mm=scd_mmm, # the meta-model of class diagrams (= our meta-meta-model)
|
|
||||||
)
|
|
||||||
print("OK")
|
|
||||||
|
|
||||||
# As a double-check, you can serialize the parsed model:
|
|
||||||
# print("--------------")
|
|
||||||
# print(indent(
|
|
||||||
# renderer.render_od(state,
|
|
||||||
# m_id=woods_mm,
|
|
||||||
# mm_id=scd_mmm),
|
|
||||||
# 4))
|
|
||||||
# print("--------------")
|
|
||||||
|
|
||||||
print("Is our 'woods' meta-model a valid class diagram?")
|
|
||||||
conf = Conformance(state, woods_mm, scd_mmm)
|
|
||||||
print(render_conformance_check_result(conf.check_nominal()))
|
|
||||||
|
|
||||||
# Change this:
|
|
||||||
woods_m_cs = """
|
|
||||||
george:Man {
|
|
||||||
weight = 15;
|
|
||||||
}
|
|
||||||
billy:Man {
|
|
||||||
weight = 100;
|
|
||||||
}
|
|
||||||
bear1:Bear
|
|
||||||
bear2:Bear
|
|
||||||
:afraidOf (george -> bear1)
|
|
||||||
:afraidOf (george -> bear2)
|
|
||||||
:afraidOf (billy -> george)
|
|
||||||
"""
|
|
||||||
|
|
||||||
print()
|
|
||||||
print("Parsing 'woods' model...")
|
|
||||||
woods_m = parser.parse_od(
|
|
||||||
state,
|
|
||||||
m_text=woods_m_cs,
|
|
||||||
mm=woods_mm, # this time, the meta-model is the previous model we parsed
|
|
||||||
)
|
|
||||||
print("OK")
|
|
||||||
|
|
||||||
# As a double-check, you can serialize the parsed model:
|
|
||||||
# print("--------------")
|
|
||||||
# print(indent(
|
|
||||||
# renderer.render_od(state,
|
|
||||||
# m_id=woods_m,
|
|
||||||
# mm_id=woods_mm),
|
|
||||||
# 4))
|
|
||||||
# print("--------------")
|
|
||||||
|
|
||||||
print("Is our model a valid woods-diagram?")
|
|
||||||
conf = Conformance(state, woods_m, woods_mm)
|
|
||||||
print(render_conformance_check_result(conf.check_nominal()))
|
|
||||||
|
|
||||||
|
|
||||||
print()
|
|
||||||
print("==================================")
|
|
||||||
if yes_no("Print PlantUML?"):
|
|
||||||
print_mm = yes_no(" ▸ Print meta-model?")
|
|
||||||
print_m = yes_no(" ▸ Print model?")
|
|
||||||
print_conf = print_mm and print_m and yes_no(" ▸ Print conformance links?")
|
|
||||||
|
|
||||||
uml = ""
|
|
||||||
if print_mm:
|
|
||||||
uml += plantuml.render_package("Meta-model", plantuml.render_class_diagram(state, woods_mm))
|
|
||||||
if print_m:
|
|
||||||
uml += plantuml.render_package("Model", plantuml.render_object_diagram(state, woods_m, woods_mm))
|
|
||||||
if print_conf:
|
|
||||||
uml += plantuml.render_trace_conformance(state, woods_m, woods_mm)
|
|
||||||
|
|
||||||
print("==================================")
|
|
||||||
print(make_url(uml))
|
|
||||||
print("==================================")
|
|
||||||
|
|
@ -1,133 +0,0 @@
|
||||||
from state.devstate import DevState
|
|
||||||
from bootstrap.scd import bootstrap_scd
|
|
||||||
from framework.conformance import Conformance, render_conformance_check_result
|
|
||||||
from concrete_syntax.textual_cd import parser as parser_cd
|
|
||||||
from concrete_syntax.textual_od import parser as parser_od
|
|
||||||
from concrete_syntax.textual_od import renderer as renderer_od
|
|
||||||
from concrete_syntax.common import indent
|
|
||||||
from concrete_syntax.plantuml import renderer as plantuml
|
|
||||||
from util.prompt import yes_no, pause
|
|
||||||
|
|
||||||
state = DevState()
|
|
||||||
|
|
||||||
print("Loading meta-meta-model...")
|
|
||||||
scd_mmm = bootstrap_scd(state)
|
|
||||||
print("OK")
|
|
||||||
|
|
||||||
print("Is our meta-meta-model a valid class diagram?")
|
|
||||||
conf = Conformance(state, scd_mmm, scd_mmm)
|
|
||||||
print(render_conformance_check_result(conf.check_nominal()))
|
|
||||||
|
|
||||||
# If you are curious, you can serialize the meta-meta-model:
|
|
||||||
# print("--------------")
|
|
||||||
# print(indent(
|
|
||||||
# renderer.render_od(state,
|
|
||||||
# m_id=scd_mmm,
|
|
||||||
# mm_id=scd_mmm),
|
|
||||||
# 4))
|
|
||||||
# print("--------------")
|
|
||||||
|
|
||||||
|
|
||||||
# Change this:
|
|
||||||
woods_mm_cs = """
|
|
||||||
abstract class Animal
|
|
||||||
|
|
||||||
class Bear (Animal) # Bear inherits Animal
|
|
||||||
|
|
||||||
class Man [1..2] (Animal) {
|
|
||||||
Integer weight `get_value(get_target(this)) > 20`; # <- constraint in context of attribute-link
|
|
||||||
|
|
||||||
`get_value(get_slot(this, "weight")) > 20` # <- constraint in context of Man-object
|
|
||||||
}
|
|
||||||
|
|
||||||
association afraidOf [0..6] Man -> Animal [1..2]
|
|
||||||
|
|
||||||
global total_weight_small_enough ```
|
|
||||||
total_weight = 0
|
|
||||||
for man_name, man_id in get_all_instances("Man"):
|
|
||||||
total_weight += get_value(get_slot(man_id, "weight"))
|
|
||||||
total_weight < 85
|
|
||||||
```
|
|
||||||
"""
|
|
||||||
|
|
||||||
print()
|
|
||||||
print("Parsing 'woods' meta-model...")
|
|
||||||
woods_mm = parser_cd.parse_cd(
|
|
||||||
state,
|
|
||||||
m_text=woods_mm_cs, # the string of text to parse
|
|
||||||
)
|
|
||||||
print("OK")
|
|
||||||
|
|
||||||
# We can serialize the class diagram to our object diagram syntax
|
|
||||||
# (because the class diagram IS also an object diagram):
|
|
||||||
print("--------------")
|
|
||||||
print(indent(
|
|
||||||
renderer_od.render_od(state,
|
|
||||||
m_id=woods_mm,
|
|
||||||
mm_id=scd_mmm),
|
|
||||||
4))
|
|
||||||
print("--------------")
|
|
||||||
|
|
||||||
print("Is our 'woods' meta-model a valid class diagram?")
|
|
||||||
conf = Conformance(state, woods_mm, scd_mmm)
|
|
||||||
print(render_conformance_check_result(conf.check_nominal()))
|
|
||||||
|
|
||||||
# Change this:
|
|
||||||
woods_m_cs = """
|
|
||||||
george:Man {
|
|
||||||
weight = 15;
|
|
||||||
}
|
|
||||||
billy:Man {
|
|
||||||
weight = 100;
|
|
||||||
}
|
|
||||||
bear1:Bear
|
|
||||||
bear2:Bear
|
|
||||||
:afraidOf (george -> bear1)
|
|
||||||
:afraidOf (george -> bear2)
|
|
||||||
"""
|
|
||||||
|
|
||||||
print()
|
|
||||||
print("Parsing 'woods' model...")
|
|
||||||
woods_m = parser_od.parse_od(
|
|
||||||
state,
|
|
||||||
m_text=woods_m_cs,
|
|
||||||
mm=woods_mm, # this time, the meta-model is the previous model we parsed
|
|
||||||
)
|
|
||||||
print("OK")
|
|
||||||
|
|
||||||
# As a double-check, you can serialize the parsed model:
|
|
||||||
# print("--------------")
|
|
||||||
# print(indent(
|
|
||||||
# renderer.render_od(state,
|
|
||||||
# m_id=woods_m,
|
|
||||||
# mm_id=woods_mm),
|
|
||||||
# 4))
|
|
||||||
# print("--------------")
|
|
||||||
|
|
||||||
print("Is our model a valid woods-diagram?")
|
|
||||||
conf = Conformance(state, woods_m, woods_mm)
|
|
||||||
print(render_conformance_check_result(conf.check_nominal()))
|
|
||||||
|
|
||||||
|
|
||||||
print()
|
|
||||||
print("==================================")
|
|
||||||
if yes_no("Print PlantUML?"):
|
|
||||||
print_mm = yes_no(" ▸ Print meta-model?")
|
|
||||||
print_m = yes_no(" ▸ Print model?")
|
|
||||||
print_conf = print_mm and print_m and yes_no(" ▸ Print conformance links?")
|
|
||||||
|
|
||||||
uml = ""
|
|
||||||
if print_mm:
|
|
||||||
uml += plantuml.render_package("Meta-model", plantuml.render_class_diagram(state, woods_mm))
|
|
||||||
if print_m:
|
|
||||||
uml += plantuml.render_package("Model", plantuml.render_object_diagram(state, woods_m, woods_mm))
|
|
||||||
if print_conf:
|
|
||||||
uml += plantuml.render_trace_conformance(state, woods_m, woods_mm)
|
|
||||||
|
|
||||||
print("==================================")
|
|
||||||
print(uml)
|
|
||||||
print("==================================")
|
|
||||||
print("Go to either:")
|
|
||||||
print(" ▸ https://www.plantuml.com/plantuml/uml")
|
|
||||||
print(" ▸ https://mstro.duckdns.org/plantuml/uml")
|
|
||||||
print("and paste the above string.")
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
start:Start {
|
|
||||||
ports_exec = `["F","FF"]`;
|
|
||||||
}
|
|
||||||
end:End {
|
|
||||||
ports_exec = `["F"]`;
|
|
||||||
}
|
|
||||||
|
|
||||||
p1:Print{
|
|
||||||
custom = "Foo";
|
|
||||||
}
|
|
||||||
|
|
||||||
p2:Print{
|
|
||||||
custom = "FooFoo";
|
|
||||||
}
|
|
||||||
|
|
||||||
p3:Print{
|
|
||||||
custom = "FooFooFoo";
|
|
||||||
}
|
|
||||||
|
|
||||||
:Conn_exec (start -> p1) {from="F";to="in";}
|
|
||||||
:Conn_exec (p1 -> end) {from="out";to="F";}
|
|
||||||
:Conn_exec (start -> p2) {from="FF";to="in";}
|
|
||||||
:Conn_exec (p2 -> end) {from="out";to="F";}
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<mxfile host="Electron" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/27.0.5 Chrome/134.0.6998.205 Electron/35.3.0 Safari/537.36" version="27.0.5" pages="4">
|
<mxfile host="Electron" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/26.1.1 Chrome/134.0.6998.205 Electron/35.5.0 Safari/537.36" version="26.1.1" pages="4">
|
||||||
<diagram name="main" id="7loCSpFFTrw_GtNaECtm">
|
<diagram name="main" id="7loCSpFFTrw_GtNaECtm">
|
||||||
<mxGraphModel dx="1042" dy="626" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
|
<mxGraphModel dx="912" dy="719" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
|
||||||
<root>
|
<root>
|
||||||
<mxCell id="0" />
|
<mxCell id="0" />
|
||||||
<mxCell id="1" parent="0" />
|
<mxCell id="1" parent="0" />
|
||||||
|
|
@ -70,7 +70,7 @@
|
||||||
<mxGeometry x="10" y="60" width="60" height="40" as="geometry" />
|
<mxGeometry x="10" y="60" width="60" height="40" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
</object>
|
</object>
|
||||||
<mxCell id="okR2fhRwQtHO20KEb0BA-20" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="okR2fhRwQtHO20KEb0BA-5" target="okR2fhRwQtHO20KEb0BA-15" edge="1">
|
<mxCell id="okR2fhRwQtHO20KEb0BA-20" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;fillColor=#dae8fc;strokeColor=#6c8ebf;strokeWidth=2;" parent="1" source="okR2fhRwQtHO20KEb0BA-5" target="okR2fhRwQtHO20KEb0BA-15" edge="1">
|
||||||
<mxGeometry relative="1" as="geometry" />
|
<mxGeometry relative="1" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<object label="%name%: %type%
%file%" placeholders="1" name="find first that can fire" type="Schedule" file="check_nac" id="AWz2q_jGxnOfZjJ20oEo-31">
|
<object label="%name%: %type%
%file%" placeholders="1" name="find first that can fire" type="Schedule" file="check_nac" id="AWz2q_jGxnOfZjJ20oEo-31">
|
||||||
|
|
@ -111,7 +111,7 @@
|
||||||
<mxGeometry x="10" y="60" width="60" height="40" as="geometry" />
|
<mxGeometry x="10" y="60" width="60" height="40" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
</object>
|
</object>
|
||||||
<mxCell id="_ZUP5PYB2ZkPahpFH5fo-6" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="okR2fhRwQtHO20KEb0BA-17" target="_ZUP5PYB2ZkPahpFH5fo-1" edge="1">
|
<mxCell id="_ZUP5PYB2ZkPahpFH5fo-6" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" source="okR2fhRwQtHO20KEb0BA-17" target="_ZUP5PYB2ZkPahpFH5fo-1" edge="1">
|
||||||
<mxGeometry relative="1" as="geometry">
|
<mxGeometry relative="1" as="geometry">
|
||||||
<Array as="points">
|
<Array as="points">
|
||||||
<mxPoint x="500" y="410" />
|
<mxPoint x="500" y="410" />
|
||||||
|
|
@ -185,7 +185,7 @@
|
||||||
<mxGeometry x="10" y="10" width="60" height="40" as="geometry" />
|
<mxGeometry x="10" y="10" width="60" height="40" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
</object>
|
</object>
|
||||||
<mxCell id="qfxbZ8cPFIYkKl1hvR_z-1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="7FO2QKo1IHTQBZ6BJbAA-7" target="7FO2QKo1IHTQBZ6BJbAA-13" edge="1">
|
<mxCell id="qfxbZ8cPFIYkKl1hvR_z-1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fillColor=#dae8fc;strokeColor=#6c8ebf;strokeWidth=2;" parent="1" source="7FO2QKo1IHTQBZ6BJbAA-7" target="7FO2QKo1IHTQBZ6BJbAA-13" edge="1">
|
||||||
<mxGeometry relative="1" as="geometry">
|
<mxGeometry relative="1" as="geometry">
|
||||||
<Array as="points">
|
<Array as="points">
|
||||||
<mxPoint x="939.9300000000001" y="200" />
|
<mxPoint x="939.9300000000001" y="200" />
|
||||||
|
|
@ -218,10 +218,10 @@
|
||||||
<mxRectangle width="80" height="60" as="alternateBounds" />
|
<mxRectangle width="80" height="60" as="alternateBounds" />
|
||||||
</mxGeometry>
|
</mxGeometry>
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="16WNXanlPmjoLkNVfXpS-1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="okR2fhRwQtHO20KEb0BA-18" target="AWz2q_jGxnOfZjJ20oEo-34">
|
<mxCell id="16WNXanlPmjoLkNVfXpS-1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fillColor=#dae8fc;strokeColor=#6c8ebf;strokeWidth=2;" parent="1" source="okR2fhRwQtHO20KEb0BA-18" target="AWz2q_jGxnOfZjJ20oEo-34" edge="1">
|
||||||
<mxGeometry relative="1" as="geometry" />
|
<mxGeometry relative="1" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="16WNXanlPmjoLkNVfXpS-2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="7FO2QKo1IHTQBZ6BJbAA-16" target="qfxbZ8cPFIYkKl1hvR_z-11">
|
<mxCell id="16WNXanlPmjoLkNVfXpS-2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fillColor=#dae8fc;strokeColor=#6c8ebf;strokeWidth=2;" parent="1" source="7FO2QKo1IHTQBZ6BJbAA-16" target="qfxbZ8cPFIYkKl1hvR_z-11" edge="1">
|
||||||
<mxGeometry relative="1" as="geometry">
|
<mxGeometry relative="1" as="geometry">
|
||||||
<Array as="points">
|
<Array as="points">
|
||||||
<mxPoint x="939.9300000000001" y="430" />
|
<mxPoint x="939.9300000000001" y="430" />
|
||||||
|
|
@ -231,7 +231,7 @@
|
||||||
</Array>
|
</Array>
|
||||||
</mxGeometry>
|
</mxGeometry>
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="16WNXanlPmjoLkNVfXpS-3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;curved=0;jumpStyle=gap;jumpSize=10;" edge="1" parent="1" source="okR2fhRwQtHO20KEb0BA-19" target="qfxbZ8cPFIYkKl1hvR_z-11">
|
<mxCell id="16WNXanlPmjoLkNVfXpS-3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;curved=0;jumpStyle=gap;jumpSize=10;fillColor=#dae8fc;strokeColor=#6c8ebf;strokeWidth=2;" parent="1" source="okR2fhRwQtHO20KEb0BA-19" target="qfxbZ8cPFIYkKl1hvR_z-11" edge="1">
|
||||||
<mxGeometry relative="1" as="geometry">
|
<mxGeometry relative="1" as="geometry">
|
||||||
<Array as="points">
|
<Array as="points">
|
||||||
<mxPoint x="480" y="360" />
|
<mxPoint x="480" y="360" />
|
||||||
|
|
@ -239,13 +239,13 @@
|
||||||
</Array>
|
</Array>
|
||||||
</mxGeometry>
|
</mxGeometry>
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="HUEgSa0tznzWzqEGNiE2-1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="_ZUP5PYB2ZkPahpFH5fo-3" target="7FO2QKo1IHTQBZ6BJbAA-5">
|
<mxCell id="HUEgSa0tznzWzqEGNiE2-1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" source="_ZUP5PYB2ZkPahpFH5fo-3" target="7FO2QKo1IHTQBZ6BJbAA-5" edge="1">
|
||||||
<mxGeometry relative="1" as="geometry" />
|
<mxGeometry relative="1" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="HUEgSa0tznzWzqEGNiE2-2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="_ZUP5PYB2ZkPahpFH5fo-3" target="7FO2QKo1IHTQBZ6BJbAA-14">
|
<mxCell id="HUEgSa0tznzWzqEGNiE2-2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" source="_ZUP5PYB2ZkPahpFH5fo-3" target="7FO2QKo1IHTQBZ6BJbAA-14" edge="1">
|
||||||
<mxGeometry relative="1" as="geometry" />
|
<mxGeometry relative="1" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="HUEgSa0tznzWzqEGNiE2-3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="AWz2q_jGxnOfZjJ20oEo-36" target="7FO2QKo1IHTQBZ6BJbAA-4">
|
<mxCell id="HUEgSa0tznzWzqEGNiE2-3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fillColor=#dae8fc;strokeColor=#6c8ebf;strokeWidth=2;" parent="1" source="AWz2q_jGxnOfZjJ20oEo-36" target="7FO2QKo1IHTQBZ6BJbAA-4" edge="1">
|
||||||
<mxGeometry relative="1" as="geometry">
|
<mxGeometry relative="1" as="geometry">
|
||||||
<Array as="points">
|
<Array as="points">
|
||||||
<mxPoint x="700" y="310" />
|
<mxPoint x="700" y="310" />
|
||||||
|
|
|
||||||
|
|
@ -187,16 +187,16 @@ def show_petri_net(m):
|
||||||
return f"""
|
return f"""
|
||||||
t1 t2 t3
|
t1 t2 t3
|
||||||
┌─┐ p1 ┌─┐ p2 ┌─┐
|
┌─┐ p1 ┌─┐ p2 ┌─┐
|
||||||
│ │ --- │ │ --- │ │
|
│ │ │ │ │ │
|
||||||
│ ├─────► ( {p1} )─────►│ │─────► ( {p2} )─────►│ │
|
│ ├─────► ( {p1} )─────►│ │─────► ( {p2} )─────►│ │
|
||||||
└─┘ --- └─┘ --- └─┘
|
└─┘ └─┘ └─┘
|
||||||
▲ │ ▲ │
|
▲ │ ▲ │
|
||||||
│ │ │ │
|
│ │ │ │
|
||||||
│ │ │ │
|
│ │ │ │
|
||||||
│ │ │ │
|
│ │ │ │
|
||||||
│ --- │ │ --- │
|
│ │ │ │
|
||||||
└───────( {cp1} )◄──────┘ └──────( {cp2} )◄───────┘
|
└───────( {cp1} )◄──────┘ └──────( {cp2} )◄───────┘
|
||||||
--- ---
|
|
||||||
cp1 cp2 """
|
cp1 cp2 """
|
||||||
|
|
||||||
# Let's see if it works:
|
# Let's see if it works:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue