petrinet_ports.mvc 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. include "primitives.alh"
  2. SimpleClassDiagrams PetriNetsPorts {
  3. SimpleAttribute Natural{
  4. constraint = $
  5. String function constraint(model : Element, name : String):
  6. if (is_physical_int(model["model"][name])):
  7. return "OK"!
  8. else:
  9. return "Natural has non-integer value"!
  10. $
  11. }
  12. SimpleAttribute String{
  13. constraint = $
  14. String function constraint(model : Element, name : String):
  15. if (is_physical_string(model["model"][name])):
  16. return "OK"!
  17. else:
  18. return "String has non-string value"!
  19. $
  20. }
  21. SimpleAttribute Boolean {}
  22. Class Named {
  23. name : String
  24. }
  25. Class Place : Named {
  26. tokens : Natural
  27. }
  28. Class Transition : Named {}
  29. Class Port : Named {
  30. selected? : Boolean
  31. }
  32. Association P2T (Place, Transition) {}
  33. Association T2P (Transition, Place) {}
  34. Association PortPlace (Port, Place) {}
  35. Association Related (Port, Port) {}
  36. }