-
Notifications
You must be signed in to change notification settings - Fork 0
/
Synthesis_Simulation.tooldef2
40 lines (35 loc) · 1.37 KB
/
Synthesis_Simulation.tooldef2
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
from "lib:cif3" import *;
// Output files
string sup_path = "generated_files/f_supervisor.cif"; //Location of supervisor
string mrg_path = "generated_files/g_supervisor_hybrid.cif"; //Location of supervisor & simulation/hybrid merged
// Input files
string in_path_db = "b_requirement.cif"; //Location of plant & requirement models
string sim_path = "c_simulation.cif"; //Location of simulation/hybrid model
// Create directory for generated files.
mkdir("generated_files", force=true);
// Synthesise supervisor.
outln("File \"%s\": synthesizing...", sup_path);
cif3datasynth(in_path_db,
"--option-dialog=1",
"-o", sup_path,
"-n", fmt("sup"),
"-t normal",
"-m debug",
"--stats=timing",
"--bdd-table=400000");
outln("File \"%s\": synthesized.", sup_path);
// Merge supervisor with hybrid plant simulation model.
outln("File \"%s\": generating...", mrg_path);
cif3merge(sup_path, sim_path, "-o", mrg_path);
outln("File \"%s\": generated.", mrg_path);
// Simulate the supervisor/hybrid plants simulation model.
outln("Simulating \"%s\"...", mrg_path);
outln();
cif3sim(mrg_path,
"-i svg",
"-a first",
"--frame-rate=20",
"--speed=1",
"--solver-root-maxchk=0.01",
"--max-delay=10.0",
"--option-dialog=yes");