-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexamples.sh
executable file
·128 lines (108 loc) · 3.21 KB
/
examples.sh
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#!/bin/bash
#
# Runs examples using FGS.
###############################################################################
# Script functions
###############################################################################
run()
{
echo ./fgs.sh -s "\"$1\"" -e "\"$2\""
./fgs.sh -s "$1" -e "$2" -verbose 2 -max-depth 100 -max-synch-steps 300
}
# Example
run_example_dog()
{
scenario="examples/EMMAS Dog/dog.emmas.scenario.xml"
experiment="examples/EMMAS Dog/dog.simpurpverif.experiment.xml"
run "$scenario" "$experiment"
}
# Example
run_example_osn()
{
scenario="examples/EMMAS Online Social Network/osn.emmas.scenario.xml"
experiment="examples/EMMAS Online Social Network/osn.simpurpverif.experiment.xml"
run "$scenario" "$experiment"
}
# Example
run_example_factory()
{
scenario="examples/EMMAS Factory/factory.emmas.scenario.xml"
experiment="examples/EMMAS Factory/factory.simpurpverif.experiment.xml"
run "$scenario" "$experiment"
}
# Example
run_example_behavior_elimination()
{
scenario="examples/EMMAS Behavior Elimination/elimination.emmas.scenario.xml"
experiment="examples/EMMAS Behavior Elimination/elimination.simpurpverif.experiment.xml"
run "$scenario" "$experiment"
}
# Example
run_example_operant_chaining()
{
scenario="examples/EMMAS Operant Chaining/worker.emmas.scenario.xml"
experiment="examples/EMMAS Operant Chaining/worker.simpurpverif.experiment.xml"
run "$scenario" "$experiment"
}
# Example
run_example_school()
{
scenario="examples/EMMAS School/school.emmas.scenario.xml"
experiment="examples/EMMAS School/school.simpurpverif.experiment.xml"
run "$scenario" "$experiment"
}
print_usage()
{
echo "FGS - Formally Guided Simulator"
echo "Examples Script"
echo ""
echo "Usage: $0 EXAMPLE"
echo ""
echo " where the EXAMPLE parameter is one of the following:"
echo ""
echo " dog A classical conditioning example involving just one dog."
echo " chaining Operant chaining in a worker."
echo " elimination Behavior elimination in a problem child."
echo " factory How to setup managers and workers so that production achieves"
echo " desirable level?"
echo " school Investigates discipline in school children."
echo " osn Marketing in an online social network."
echo ""
echo ""
echo "Note: You may wish to modify this script in order to employ different parameters"
echo "when calling FGS. In particular, it may be necessary to edit the function"
echo "run() to define larger values for parameters -max-depth and"
echo "-max-synch-steps in order to avoid inconclusive verdicts."
echo ""
}
###############################################################################
# Main body of the script
###############################################################################
if [[ $# != 1 ]]; then
print_usage
else
case "$1" in
'dog')
run_example_dog
;;
'chaining')
run_example_operant_chaining
;;
'elimination')
run_example_behavior_elimination
;;
'factory')
run_example_factory
;;
'school')
run_example_school
;;
'osn')
run_example_osn
;;
*)
echo "Invalid choice."
print_usage
;;
esac
fi