69build_call(Platform,ManagerHost,ManagerPort,File,Options,xterm,Command) :-
70 build_call2(Platform,ManagerHost,ManagerPort,File,Options,Command2),
71 executable_path(xterm, Exterm),
72 concat_atom([Exterm, ' -e ', Command2], Command).
73
74build_call(Platform,ManagerHost,ManagerPort,File,Options,silent,Command) :-
75 build_call2(Platform,ManagerHost,ManagerPort,File,Options,Command2),
77 concat_atom([Command2, ' 1>debug.txt 2>debug.txt'], Command).
78
79
80build_call2(eclipse,ManagerHost,ManagerPort,File,Options,Command) :-
81 executable_path(eclipse, Eeclipse),
82 concat_atom([Eeclipse, ' -g 10M host=', ManagerHost,
83 ' port=', ManagerPort,
84 ' -b ', File, ' -e ', ' start ', Options], Command).
85build_call2(swi,ManagerHost,ManagerPort,File,Options,Command) :-
86 executable_path(swi, Eswi),
87 concat_atom([Eswi, ' -t ', ' start',
88 ' -f ', File,
89 ' host=', ManagerHost,
90 ' port=', ManagerPort,' ', Options], Command).
91
92
93
94
95
101device_manager(simulator, Platform, Command, [Host, Port]):-
102 main_dir(Dir),
103 concat_atom([Dir,'Env/env_sim.pl'], File),
104 build_call(Platform,Host,Port,File,'',xterm,Command).
105
106
107
113device_manager(rcx, eclipse, Command, [Host, Port]):-
114 main_dir(Dir),
115 concat_atom([Dir,'Env/env_rcx.pl'], File),
116 build_call(eclipse,Host,Port,File,'',xterm,Command).
117
118
124device_manager(internet, Platform, Command, [Host, Port]):-
125 main_dir(Dir),
126 concat_atom([Dir,'Env/env_int.pl'], File),
127 build_call(Platform,Host,Port,File,'',xterm,Command).
128
129
153device_manager(er1, swi, Command, [Host, Port]):-
154 main_dir(Dir),
155 er1_location(IPER1, PORTER1),
156 concat_atom([Dir,'Env/env_er1.pl'], File),
157 159 160 concat_atom(['debug=4 ',' iper1=', IPER1, ' porter1=', PORTER1], Options),
161 build_call(swi,Host,Port,File,Options,xterm,Command).
162
164er1_location('er1.cs.toronto.edu', 9000).
165
166
167
174wumpus_location('10.10.10.111', 9002).
175
177device_manager(virtual_wumpus, swi, Command, [Host, Port]):-
178 main_dir(Dir),
179 wumpus_location(IPW, PORTW),
180 wumpus_config(TIDRun,Size,PPits,NoGolds,TIDScenario),
181 term_to_atom(TIDRun, IDRun),
182 term_to_atom(TIDScenario, IDScenario),
183 concat_atom([Dir,'Env/env_wumpus.pl'], File),
184 concat_atom([' debug=1',
185 ' ipwumpus=', IPW, ' portwumpus=', PORTW,
186 ' ppits=', PPits, ' nogolds=', NoGolds, ' size=', Size,
187 ' idrun=\'', IDRun, '\' idscenario=\'', IDScenario,'\''
188 ], Options),
189 build_call(swi,Host,Port,File,Options,xterm,Command).
190
192device_manager(virtual_wumpus_silent, swi, Command, [Host, Port]):-
193 main_dir(Dir),
194 wumpus_location(IPW, PORTW),
195 wumpus_config(TIDRun,Size,PPits,NoGolds,TIDScenario),
196 term_to_atom(TIDRun, IDRun),
197 term_to_atom(TIDScenario, IDScenario),
198 concat_atom([Dir,'Env/env_wumpus.pl'], File),
199 concat_atom([' debug=1',
200 ' ipwumpus=', IPW, ' portwumpus=', PORTW,
201 ' ppits=', PPits, ' nogolds=', NoGolds, ' size=', Size,
202 ' idrun=\'', IDRun, '\' idscenario=\'', IDScenario,'\''
203 ], Options),
204 build_call(swi,Host,Port,File,Options,silent,Command).
205
206
208device_manager(virtual_wumpus_vworld, swi, Command, [Host, Port]):-
209 main_dir(Dir),
210 wumpus_location(IPW, PORTW),
211 wumpus_config(TIDRun,Size,PPits,NoGolds,TIDScenario),
212 term_to_atom(TIDRun, IDRun),
213 term_to_atom(TIDScenario, IDScenario),
214 concat_atom([Dir,'Env/env_wumpus.pl'], File),
215 concat_atom([' debug=1',
216 ' ipwumpus=', IPW, ' portwumpus=', PORTW,
217 ' ppits=', PPits, ' nogolds=', NoGolds, ' size=', Size,
218 ' idrun=\'', IDRun, '\' idscenario=\'', IDScenario,'\''
219 ], Options),
220 build_call(swi,Host,Port,File,Options,xterm,Command).
221
222
226device_manager(clima07(LOptions), swi, (Command, LArgs), [HostEM, PortEM]):-
227 main_dir(Dir),
228 clima_location(IPCLIMA, PORTCLIMA),
229 clima_agentID(TAgentName, TAgentPass),
230 term_to_atom(TAgentName, AgentName),
231 term_to_atom(TAgentPass, AgentPass),
232 concat_atom([Dir,'Env/env_clima.pl'], File),
233 (member(debug(Debug), LOptions) -> true ; Debug=3),
234 235 concat_atom(['host=', HostEM], ArgHost),
236 concat_atom(['port=', PortEM], ArgPort),
237 concat_atom(['debug=', Debug], ArgDebug),
238 concat_atom(['ipsim=', IPCLIMA], ArgIPCLIMA),
239 concat_atom(['portsim=', PORTCLIMA], ArgPortCLIMA),
240 concat_atom(['agentLogin=', AgentName], ArgAgentLog),
241 concat_atom(['agentPass=', AgentPass], ArgAgentPass),
242 LPrologArgs=['-t','start','-f',File,ArgHost,ArgPort,ArgDebug,ArgIPCLIMA,ArgPortCLIMA,
243 ArgAgentLog,ArgAgentPass],
244 245 executable_path(swi, Eswi),
246 executable_path(xterm, Exterm),
247 (member(quiet, LOptions) ->
248 append(LPrologArgs,[' >/dev/null 2>/dev/null'],LPrologArgs2),
249 join_atom([Eswi|LPrologArgs2], ' ',Arg),
250 LArgs=['-c', Arg],
251 Command=sh
252 ;
253 join_atom([Eswi|LPrologArgs], ' ',Arg),
254 LArgs=['-e', Arg],
255 Command=Exterm
256 ).
257
258
263
264
265
266
270device_manager(messenger(LOptions), swi, (Command, LArgs), [HostEM, PortEM]):-
271 main_dir(Dir),
272 mess_location(IPMESS, PORTMESS),
273 agentID(TAgentName),
274 term_to_atom(TAgentName, AgentName),
275 concat_atom([Dir,'Env/env_mess.pl'], File),
276 (member(debug(Debug), LOptions) -> true ; Debug=3),
277 278 concat_atom(['host=', HostEM], ArgHost),
279 concat_atom(['port=', PortEM], ArgPort),
280 concat_atom(['debug=', Debug], ArgDebug),
281 concat_atom(['ipmess=', IPMESS], ArgIPMESS),
282 concat_atom(['portmess=', PORTMESS], ArgPortMESS),
283 concat_atom(['agentLogin=', AgentName], ArgAgent),
284 LPrologArgs=['-t','start','-f',File,ArgHost,ArgPort,ArgDebug,ArgIPMESS,ArgPortMESS,ArgAgent],
285 286 executable_path(swi, Eswi),
287 executable_path(xterm, Exterm),
288 (member(quiet, LOptions) ->
289 append(LPrologArgs,[' >/dev/null 2>/dev/null'],LPrologArgs2),
290 join_atom([Eswi|LPrologArgs2], ' ',Arg),
291 LArgs=['-c', Arg],
292 Command=sh
293 ;
294 join_atom([Eswi|LPrologArgs], ' ',Arg),
295 LArgs=['-e',Arg],
296 Command=Exterm
297 ).
298
299
304
305
306
307
308
309
310
311
317device_manager(javaswing, swi, Command, [Host, Port]):-
318 main_dir(Dir),
319 swing_location(IPSW, PORTSW),
320 concat_atom([Dir,'Env/env_java_swing.pl'], File),
321 concat_atom([' ipswing=', IPSW, ' portswing=', PORTSW], Options),
322 build_call(swi, Host, Port, File, Options, xterm, Command).
323
324
325
326
332device_manager(javaswings(Id), swi, Command, [Host, Port]):-
333 main_dir(Dir),
334 swing_location(IPSW, PORTSW, Id),
335 concat_atom([Dir,'Env/env_java_swing_id.pl'], File),
336 concat_atom([' ipswing=', IPSW, ' portswing=', PORTSW,' id=',Id], Options),
337 build_call(swi, Host, Port, File, Options, xterm, Command).
338
339
340
341
342
343
344