Skip to content

Commit

Permalink
exporting marking if connected to lpn
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamBanham committed Oct 21, 2024
1 parent 789438b commit 9d7e0a5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pmkoalas/models/petrinet.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,14 @@ def getUUID() -> str:
'localNodeID' : getUUID()
}
)
if net.initial_marking and net.initial_marking.contains(place):
imarking = ET.SubElement(placeNode,'initialMarking')
text_node = ET.SubElement(imarking,'text')
text_node.text = str(net.initial_marking[place])
if net.final_marking and net.final_marking.contains(place):
fmarking = ET.SubElement(placeNode,'finalMarking')
text_node = ET.SubElement(fmarking,'text')
text_node.text = str(net.final_marking[place])

for tran in net.transitions:
# work out the id for the transition
Expand Down

0 comments on commit 9d7e0a5

Please sign in to comment.