12345678910111213141516171819202122232425262728293031323334353637 |
- import models/SimpleClassDiagrams as SCD
- include "primitives.alh"
- SCD PetriNets{
- SimpleAttribute Natural {
- constraint =
- $
- String function constraint_Natural(model : Element, name : String):
- Element self
- self = model["model"][name]
- if (is_physical_int(self)):
- if (integer_gte(self, 0)):
- return "OK"!
- else:
- return "Natural number not larger than or equal to zero"!
- else:
- return "Natural number not larger than or equal to zero"!
- $
- }
- Class Place{
- tokens : Natural
- }
- Class Transition{}
- Association P2T (Place, Transition) {
- weight : Natural
- }
- Association T2P (Transition, Place) {
- weight : Natural
- }
- }
- export PetriNets to models/PetriNets
|