-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.py
35 lines (30 loc) · 907 Bytes
/
example.py
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
import hybrid
ex = hybrid.Example()
words = ["", "a", "b"]
def never_s1_until_s3():
task = hybrid.DFA(
list(range(4)),
0,
[1], # accepting
[3], #rejecting,
[2], #done
)
task.add_transition(0, "a", 1)
task.add_transition(0, "b", 3)
task.add_transition(0, "", 0)
for w in words:
task.add_transition(1, w, 2)
task.add_transition(2, w, 2)
task.add_transition(3, w, 3)
return task
mission = hybrid.Mission()
dfa = never_s1_until_s3()
mission.add_task(dfa)
scpm = hybrid.SCPM(mission, 1, list(range(2))) # A single agent, 2 actions, carrying out reachability task
t = [-2.5, 0.7] # achievable
#t = [-1.8, 0.9] # unachievable
eps = 0.0001
w = [1., 0]
C = [1., 0.]
hybrid.example_cpu(scpm, ex, w, 1e-6, 1)
hybrid.ex_synthesis(scpm, ex, w, t, 1e-6, 1e-4, 2, C) # set verbosity to 2 (last param) to print pareto points