123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313 |
- {
- "types": {
- "State": [
- {
- "name": "name",
- "type": "string",
- "default": ""
- },
- {
- "name": "initial",
- "type": "boolean",
- "default": false
- },
- {
- "name": "current",
- "type": "boolean",
- "default": false
- }
- ],
- "Interrupt": [
- {
- "name": "at",
- "type": "int",
- "default": 0
- },
- {
- "name": "event",
- "type": "string",
- "default": "E"
- },
- {
- "name": "current",
- "type": "boolean",
- "default": false
- }
- ],
- "TimedTransition": [
- {
- "name": "after",
- "type": "int",
- "default": 0
- }
- ],
- "InterruptTransition": [
- {
- "name": "interrupt",
- "type": "string",
- "default": "E"
- }
- ],
- "Time": [
- {
- "name": "clock",
- "type": "int",
- "default": 0
- }
- ],
- "AbstractInterrupt": [
- {
- "name": "current",
- "type": "boolean",
- "default": false
- }
- ],
- "Next": [],
- "End": [
- {
- "name": "current",
- "type": "boolean",
- "default": false
- }
- ],
- "Visualisation": [
- {
- "name": "red",
- "type": "boolean",
- "default": false
- },
- {
- "name": "yellow",
- "type": "boolean",
- "default": false
- },
- {
- "name": "green",
- "type": "boolean",
- "default": false
- }
- ],
- "VisualisedBy": []
- },
- "constraints": [
- {
- "name": "max-one-instance",
- "event": "pre-create",
- "code": "getAllNodes(['/Formalisms/TrafficLight/TrafficLight/Time']).length == 0",
- "targetType": "Time"
- },
- {
- "name": "noAbstractInstances",
- "event": "pre-create",
- "code": "false",
- "targetType": "AbstractInterrupt"
- },
- {
- "name": "one-time-instance",
- "event": "",
- "targetType": "*",
- "code": "var time_instances = getAllNodes(['/Formalisms/TrafficLight/TrafficLight/Time']);\ntime_instances.length == 1"
- }
- ],
- "actions": [
- {
- "name": "set-clock",
- "event": "post-create",
- "code": "setAttr('clock', 1)",
- "targetType": "Time"
- },
- {
- "name": "set-clock",
- "event": "post-create",
- "targetType": "*",
- "code": "var instances = getAllNodes(['/Formalisms/TrafficLight/TrafficLight/Time']);\nconsole.log(instances.length);\nif (instances.length) {\n setAttr('clock', 0, instances[0]);\n}"
- }
- ],
- "cardinalities": {
- "State": [
- {
- "dir": "out",
- "type": "TimedTransition",
- "min": 0,
- "max": 1
- },
- {
- "dir": "out",
- "type": "VisualisedBy",
- "min": 1,
- "max": 1
- },
- {
- "dir": "in",
- "type": "TimedTransition",
- "min": "0",
- "max": "Infinity"
- },
- {
- "dir": "out",
- "type": "InterruptTransition",
- "min": "0",
- "max": "Infinity"
- },
- {
- "dir": "in",
- "type": "InterruptTransition",
- "min": "0",
- "max": "Infinity"
- }
- ],
- "Interrupt": [
- {
- "dir": "out",
- "type": "Next",
- "min": "0",
- "max": "1"
- },
- {
- "dir": "in",
- "type": "Next",
- "min": "0",
- "max": "1"
- }
- ],
- "TimedTransition": [
- {
- "dir": "in",
- "type": "State",
- "min": "0",
- "max": "1"
- },
- {
- "dir": "out",
- "type": "State",
- "min": "0",
- "max": "1"
- }
- ],
- "InterruptTransition": [
- {
- "dir": "in",
- "type": "State",
- "min": "0",
- "max": "1"
- },
- {
- "dir": "out",
- "type": "State",
- "min": "0",
- "max": "1"
- }
- ],
- "Time": [],
- "AbstractInterrupt": [
- {
- "dir": "in",
- "type": "Next",
- "min": "0",
- "max": "1"
- }
- ],
- "Next": [
- {
- "dir": "in",
- "type": "Interrupt",
- "min": "0",
- "max": "1"
- },
- {
- "dir": "out",
- "type": "AbstractInterrupt",
- "min": "0",
- "max": "1"
- },
- {
- "dir": "out",
- "type": "Interrupt",
- "min": "0",
- "max": "1"
- },
- {
- "dir": "out",
- "type": "End",
- "min": "0",
- "max": "1"
- }
- ],
- "End": [
- {
- "dir": "in",
- "type": "Next",
- "min": "0",
- "max": "1"
- }
- ],
- "Visualisation": [
- {
- "dir": "in",
- "type": "VisualisedBy",
- "min": "0",
- "max": "Infinity"
- }
- ],
- "VisualisedBy": [
- {
- "dir": "in",
- "type": "State",
- "min": "0",
- "max": "1"
- },
- {
- "dir": "out",
- "type": "Visualisation",
- "min": "0",
- "max": "1"
- }
- ]
- },
- "legalConnections": {
- "State": {
- "State": [
- "TimedTransition",
- "InterruptTransition"
- ],
- "Visualisation": [
- "VisualisedBy"
- ]
- },
- "Interrupt": {
- "AbstractInterrupt": [
- "Next"
- ],
- "Interrupt": [
- "Next"
- ],
- "End": [
- "Next"
- ]
- }
- },
- "connectorTypes": {
- "TimedTransition": "visual",
- "InterruptTransition": "visual",
- "Next": "visual",
- "VisualisedBy": "visual"
- },
- "types2parentTypes": {
- "State": [],
- "Interrupt": [
- "AbstractInterrupt"
- ],
- "TimedTransition": [],
- "InterruptTransition": [],
- "Time": [],
- "AbstractInterrupt": [],
- "Next": [],
- "End": [
- "AbstractInterrupt"
- ],
- "Visualisation": [],
- "VisualisedBy": [],
- "one-time-instance": [],
- "set-clock": []
- }
- }
|