-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL.txt
232 lines (146 loc) · 9.88 KB
/
INSTALL.txt
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
RDDLSim -- A simulator for the relational dynamic influence diagram
language (RDDL).
Copyright (C) 2010--2014, Scott Sanner ([email protected])
Basic RDDLSim Installation and Invocation
=========================================
rddlsim/ provides the following subdirectories:
src All source code (.java files)
bin All binaries (.class files)
lib All 3rd party libraries (.jar files)
files All supplementary files (.rddl files, etc.)
cclient A sample C++ client for the rddlsim server
Always ensure that all .jar files in lib/ are included in your
CLASSPATH for both Java compilation and at Java runtime. For
a quick way to compile the code from a terminal, you can try:
compile For Windows/Cygwin and UNIX/Linux systems
compile.bat For the Windows CMD prompt
For running RDDLSim from a terminal, we provide two scripts
run For Windows/Cygwin and UNIX/Linux systems
run.bat For the Windows CMD prompt
In both cases, run these scripts from the **rddlsim/**
directory with the class name as an argument, e.g.
Windows/Cygwin and UNIX/Linux: ./run rddl.sim.Simulator
Windows CMD prompt: .\run.bat rddl.sim.Simulator
You can pass up to 10 arguments to these scripts as required.
We highly recommend that you use Eclipse for Java development:
http://www.eclipse.org/downloads/
In Eclipse the CLASSPATH libraries can be set via
Project -> Properties -> Java Build Path -> Libraries Tab
Basic RDDLSim Usage
===================
We currently provide the following rddlsim command line utilities:
Validating RDDL Syntax and Translating RDDL to LISP-like Prefix Format:
rddl.parser.parser filename [-prefix-output]
(e.g., files/rddl/test/sysadmin.rddl for filename)
The output should be syntactically equivalent to the input. The optional
"-prefix-output" flag is useful for exporting RDDL expressions (cpfs, reward,
state-action-constraints) in prefix format for easier prefix parsing (in
case you are writing your own RDDL parser in another language).
Translating Restricted RDDL Syntax to PPDDL / SPUDD / Symbolic Perseus Format:
rddl.translate.RDDL2Format rddl-file-or-directory output-directory file-format
Popular currently supported file formats are 'spudd_sperseus' and 'ppddl'.
Also supported is a RDDL prefix translator for a file or directory:
rddl.translate.RDDL2Prefix rddl-file-or-directory output-directory
Running the RDDL Simulator Standalone:
rddl.sim.Simulator RDDL-file policy-class-name instance-name [state-viz-class-name]
(n.b., rddl.viz.GenericScreenDisplay is default for state-viz-class-name)
Visualizing the RDDL DBN:
rddl.viz.RDDL2Graph RDDL-file instance-name
(n.b., requires GraphViz, installation details at end of this file)
Running the RDDL Server and Client: [command line parameters subject to change]
rddl.competition.Server RDDL-file [port-number] [num-trials] [random-seed] [state-viz-class-name]
rddl.competition.Client RDDL-file host-name client-name policy-class-name [port-number]
n.b., (1) default port number is 2323
(2) policy-class-name:
...best example with comments: rddl.policy.SPerseusSPUDDPolicy
...otherwise, any policy class name which derives from rddl.Policy
...for *your* client, just provide a policy derived from rddl.Policy
Evaluating competition results for a directory of Client log-files:
rddl.evaluate.MinMaxEval [--time-limit TIME] [--num-trials NUM] <directory of RDDL .log files>
rddl.evaluate.FinalEval [--time-limit TIME] [--num-trials NUM] <directory of RDDL .log files>
See src/rddl/evaluate/README.txt for a full explanation.
For archives of log files from competitions, please see the respective competition websites.
Examples (run from rddlsim directory, ./run for UNIX/Cygwin, run.bat for Windows):
**Client/Server examples**
./run rddl.competition.Server files/final_comp/rddl/
./run rddl.competition.Client files/final_comp/rddl localhost MyClientName rddl.policy.SPerseusSPUDDPolicy 2323 123456 sysadmin_inst_mdp__10
./run rddl.competition.Client files/final_comp/rddl localhost MyClientName rddl.policy.SPerseusSPUDDPolicy 2323 123456 sysadmin_inst_pomdp__10
Note: see directory rddlsim/cclient for instructions
on how to build and run a C++ client.
**Parser and translation examples**
./run rddl.parser.parser files/rddl/test/sysadmin_mdp.rddl
Note: if you're building a parser for another language
use the following option to output RDDL expressions in
prefix format (rather than the current infix format):
./run rddl.parser.parser files/rddl/test/sysadmin_mdp.rddl -prefix-output
Or do the prefix translations for an entire directory:
./run rddl.translate.RDDL2Prefix files/final_comp/rddl files/final_comp/rddl_prefix
Translate to (PO-)PPDDL / SPUDD / Symbolic Perseus:
./run rddl.translate.RDDL2Format files/final_comp/rddl files/final_comp/spudd_sperseus spudd_sperseus
./run rddl.translate.RDDL2Format files/final_comp/rddl files/final_comp/ppddl ppddl
**Simulator examples**
./run rddl.sim.Simulator files/final_comp/rddl rddl.policy.RandomBoolPolicy elevators_inst_mdp__9 rddl.viz.ElevatorDisplay
./run rddl.sim.Simulator files/final_comp/rddl rddl.policy.RandomBoolPolicy game_of_life_inst_mdp__10 rddl.viz.GameOfLifeScreenDisplay
./run rddl.sim.Simulator files/final_comp/rddl rddl.policy.RandomBoolPolicy sysadmin_inst_pomdp__10 rddl.viz.SysAdminScreenDisplay
./run rddl.sim.Simulator files/final_comp/rddl rddl.policy.RandomBoolPolicy traffic_inst_mdp__10 rddl.viz.TrafficDisplay
./run rddl.sim.Simulator files/final_comp/rddl rddl.policy.RandomBoolPolicy crossing_traffic_inst_mdp__10 rddl.viz.CrossingTrafficDisplay
./run rddl.sim.Simulator files/final_comp/rddl rddl.policy.RandomBoolPolicy navigation_inst_mdp__10 rddl.viz.NavigationDisplay
./run rddl.sim.Simulator files/final_comp/rddl rddl.policy.RandomBoolPolicy navigation_inst_pomdp__10 rddl.viz.NavigationDisplay
**RDDL DBN / Influence Diagram Visualization**
./run rddl.viz.RDDL2Graph files/rddl/examples/dbn_prop.rddl inst_dbn
./run rddl.viz.RDDL2Graph files/rddl/examples/dbn_types_interm_po.rddl inst_dbn_interm_po
./run rddl.viz.RDDL2Graph files/rddl/examples/game_of_life_stoch.rddl is1_stoch
Examples of RDDL 2.0 (2013) -- A strict superset of RDDL 1.0
See RDDL2 domain examples in files/rddl2/
**RDDL2 Simulator examples**
./run rddl.sim.Simulator files/rddl2/examples/multiagent_mars_rover.rddl2 rddl.policy.RandomConcurrentPolicy inst_multiagent_mars_rover rddl.viz.MarsRoverDisplay 3 3
./run rddl.sim.Simulator files/rddl2/examples/traffic_control_ctm.rddl2 rddl.policy.RandomConcurrentPolicy inst_traffic_control_ctm rddl.viz.trfctm.TrfDisplay 2 2
./run rddl.sim.Simulator files/rddl2/examples/lang_extension_examples.rddl2 rddl.policy.RandomConcurrentPolicy inst_lang_extension_examples rddl.viz.GenericScreenDisplay 1 1
./run rddl.sim.Simulator files/rddl2/examples/power_gen.rddl2 rddl.policy.RandomConcurrentPolicy inst_power_gen rddl.viz.GenericScreenDisplay 1 1
**RDDL2 DBN / Influence Diagram Visualization**
./run rddl.viz.RDDL2Graph files/rddl2/examples/lang_extension_examples.rddl2 inst_lang_extension_examples
./run rddl.viz.RDDL2Graph files/rddl2/examples/multiagent_mars_rover.rddl2 inst_multiagent_mars_rover
./run rddl.viz.RDDL2Graph files/rddl2/examples/traffic_control_ctm.rddl2 inst_traffic_control_ctm
./run rddl.viz.RDDL2Graph files/rddl2/examples/power_gen.rddl2 inst_power_gen
GraphViz RDDL Visualization
===========================
Although not required to run the basic RDDL simulator facilities, some
additional GraphViz visualization tools are provided; see here for
general info on GraphViz:
http://www.graphviz.org/
To enable Java Graphviz visualization:
- Download and install GraphViz version 2.28 (or earlier) on your system:
http://www.graphviz.org/pub/graphviz/stable/
(language changes after 2.28 are not compatible with the Java viewer)
- Make sure "dot" and "neato" (including ".exe" if running on Windows)
are in your PATH, i.e., you can execute them from any home directory
Run graph.Graph.main() and verify that a cleanly formatted Java window
displaying a graph appears.
Run rddl.viz.RDDL2Graph.main() to convert RDDL files to interactively
view DBNs for RDDL instances in a Java viewer and export GraphViz
graph specifications for publication.
Modifying the RDDL Language
===========================
The following lexical pattern, grammar files, and Makefile are provided
in rddlsim/src/rddl/parser/
rddl.lex The lexical pattern specification for use with JLex.
rddl.cup The parser rules specification and internal representation
generation code for use with JavaCUP.
Makefile Makefile with rules for generating lexer and parser.
Note the versions of JLex and JavaCUP that we are using are *not* the
most recent versions available on the web and hence we have bundled
jlex.jar and java_cup.jar in the lib/ directory for use with compiling
these files and runtime execution.
If you make modifications to the language (not recommended if you are
competing in IPPC-2011) you can recompile the parser by first
uncommenting the following line in Makefile
SEP = :
*if* you are on a UNIX/Linux system (*otherwise* changing nothing if you
are on Windows/Cygwin) and then invoking the following commands from
the **rddlsim/src/rddl/parser/** directory:
make lex
followed by
make parser
These commands only produce the Java files in the
rddlsim/src/rddl/parser/ directory, they must be compiled
by javac (this is usually automatic if you are using Eclipse).