12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- SimpleClassDiagrams PetriNetsPorts {
- SimpleAttribute Integer{
- constraint = $
- String function constraint(model : Element, name : String):
- if (is_physical_int(model["model"][name])):
- return "OK"!
- else:
- return "Integer has non-integer value"!
- }
- SimpleAttribute String{
- constraint = $
- String function constraint(model : Element, name : String):
- if (is_physical_string(model["model"][name])):
- return "OK"!
- else:
- return "String has non-string value"!
- $
- }
- SimpleAttribute PlaceOrTransition{
- constraint = $
- String function constraint(model : Element, name : String):
- if (is_physical_string(model["model"][name])):
- if (boolean_or(value_eq(model["model"][name], "transition"), value_eq(model["model"][name], "place"))):
- return "OK"!
- else:
- return "PlaceOrTransition does not contain either 'place' or 'transition'"!
- else:
- return "PlaceOrTransition has non-string value"!
- $
- }
- Class Positionable {
- x : Integer
- y : Integer
- }
- Class Named {
- name : String
- }
- Class Boundary : Named, Positionable {}
- Class Place : Positionable, Named {
- nbTokens : Integer
- }
- Class Transition : Positionable, Named {}
- Class Port : Named, Positionable {
- sourceType : PlaceOrTransition
- targetType : PlaceOrTransition
- }
- Association Has1 (Boundary, Place) {}
- Association Has2 (Boundary, Transition) {}
- Association Has3 (Boundary, Port) {}
- Association P2T (Place, Transition) {}
- Association T2P (Transition, Place) {}
- Association PortTransition (Port, Transition) {}
- Association PortPlace (Port, Place) {}
- }
|