-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtraffic.html
55 lines (44 loc) · 896 Bytes
/
traffic.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="app.css">
</head>
<body>
</body>
<script>
var states = [
{label:'a', y:30, x:10},
{label:'b', y:30, x:30},
{label:'c', y:30, x:90},
{label:'d', y:30, x:70},
{label:'queue', y:30, x:50},
]
var transitions = [
{label: 'x', y: 20, x: 30,
pre: {a: 1},
post: {
queue: 1,
b: 1
}
},
{label: 'y', y: 40, x: 30,
pre: {b: 1, queue: 1},
post: {a: 1}
},
{label: 'w', y: 20, x: 70,
pre: {queue: 1, d: 1},
post: {c: 1}
},
{label: 'z', y: 40, x: 70,
pre: {c: 1},
post: {d: 1, queue: 1}}
];
var marking = {a: 1, d: 1};
function scaleModel(sx, sy) {
(states.concat(transitions)).forEach(function(s){s.x *= sx; s.y *= sy})
}
scaleModel(4, 4);
</script>
<script src="bundle.js"></script>
</html>