-
Notifications
You must be signed in to change notification settings - Fork 4
Petri Net Example
Sebi1006 edited this page Jun 25, 2021
·
11 revisions
This is an example project of a petri net.
node placeNode for Place {
edges {
arcPlaceTransition
}
style: placeStyle
sizeMin(width: 50, height: 50)
sizeMax(width: 50, height: 50)
resizing(horizontal: false, vertical: false, proportional: false)
ellipse {
size(width: 50, height: 50)
position(x: 0, y: 50)
textfield {
style: labelStyle
identifier: placeName
position(x: -25, y: -40)
size(width: 125, height: 15)
editable: true
align(horizontal: middle, vertical: middle)
}
}
}
node tokenNode for Token {
edges {}
style: tokenStyle
sizeMin(width: 10, height: 10)
sizeMax(width: 10, height: 10)
resizing(horizontal: false, vertical: false, proportional: false)
ellipse {
size(width: 10, height: 10)
position(x: 0, y: 50)
}
}
node transitionNode for Transition {
edges {
arcTransitionPlace
}
style: transitionStyle
sizeMin(width: 20, height: 50)
sizeMax(width: 20, height: 50)
resizing(horizontal: false, vertical: false, proportional: false)
rectangle {
size(width: 20, height: 50)
position(x: 0, y: 50)
textfield {
style: labelStyle
identifier: transitionName
position(x: -10, y: -40)
size(width: 125, height: 15)
editable: true
align(horizontal: middle, vertical: middle)
}
}
}
edge arcPlaceTransition for Place.Arc {
target: Transition
style: defaultEdge
placing {
offset: 20.0
polygon {
style: arrow
point(x: 0, y: 0)
point(x: 10, y: 5)
point(x: 7, y: 0)
point(x: 10, y: -5)
}
}
}
edge arcTransitionPlace for Transition.Arc2 {
target: Place
style: defaultEdge
placing {
offset: 20.0
polygon {
style: arrow
point(x: 0, y: 0)
point(x: 10, y: 5)
point(x: 7, y: 0)
point(x: 10, y: -5)
}
}
}
style placeStyle {
description = "Style for place"
line-color = black
line-style = dashed
line-width = 3
background-color = white
}
style tokenStyle {
description = "Style for token"
line-color = black
line-style = dashed
line-width = 3
background-color = black
}
style transitionStyle {
description = "Style for transition"
line-color = black
line-style = dashed
line-width = 3
background-color = black
}
style defaultEdge {
description = "Style for default edge"
line-width = 1
line-color = black
}
style arrow {
description = "Style for arrow"
line-width = 3
background-color = black
}
style labelStyle {
description = "Style for label"
background-color = white
}
diagram petriNet {
palette node {
placeNode
transitionNode
tokenNode
}
}