|
2 | 2 | #exec 1>/dev/null # @echo off |
3 | 3 | clear # cls |
4 | 4 | #title "MAS" |
5 | | -sicstus_home=/usr/local/sicstus4.3.5 |
6 | | -#sicstus_home=/usr/local/sicstus4.2.3 |
7 | | -main_home=../.. |
8 | | -dali_home=../../src |
9 | | -conf_dir=conf |
10 | | -prolog="$sicstus_home/bin/sicstus" |
| 5 | +SICSTUS_HOME=/usr/local/sicstus4.4.1 |
| 6 | +MAIN_HOME=../.. |
| 7 | +DALI_HOME=../../src |
| 8 | +CONF_DIR=conf |
| 9 | +PROLOG="$SICSTUS_HOME/bin/sicstus" |
11 | 10 | WAIT="ping -c 4 127.0.0.1" |
12 | | -instances_home=mas/instances |
13 | | -types_home=mas/types |
14 | | -build_home=build |
| 11 | +INSTANCES_HOME=mas/instances |
| 12 | +TYPES_HOME=mas/types |
| 13 | +BUILD_HOME=build |
| 14 | +XTERM=xterm |
15 | 15 |
|
16 | 16 | rm -rf tmp/* |
17 | 17 | rm -rf build/* |
18 | 18 | rm -f work/* # remove everything if you want to clear agent history |
19 | 19 | rm -rf conf/mas/* |
20 | 20 |
|
21 | 21 | # Build agents by creating a file with the instance name containing the type content for each instance. |
22 | | -for instance_filename in $instances_home/*.txt |
| 22 | +for instance_filename in $INSTANCES_HOME/*.txt |
23 | 23 | do |
24 | 24 | type=$(<$instance_filename) # agent type name is the content of the instance file |
25 | | - type_filename="$types_home/$type.txt" |
| 25 | + type_filename="$TYPES_HOME/$type.txt" |
26 | 26 | instance_base="${instance_filename##*/}" # e.g. 'mas/instances/agent1.txt' -> 'agent1.txt' |
27 | 27 | echo $type_filename |
28 | | - cat $type_filename >> "$build_home/$instance_base" |
| 28 | + cat $type_filename >> "$BUILD_HOME/$instance_base" |
29 | 29 | done |
30 | 30 |
|
31 | | -cp $build_home/*.txt work |
| 31 | +cp $BUILD_HOME/*.txt work |
32 | 32 |
|
33 | | -xterm -hold -e "$prolog -l $dali_home/active_server_wi.pl --goal \"go(3010,'server.txt').\"" & #start /B "" "%prolog%" -l "%dali_home%/active_server_wi.pl" --goal go(3010,'%daliH%/server.txt'). |
| 33 | +$XTERM -hold -e "$PROLOG -l $DALI_HOME/active_server_wi.pl --goal \"go(3010,'server.txt').\"" & #start /B "" "%PROLOG%" -l "%DALI_HOME%/active_server_wi.pl" --goal go(3010,'%daliH%/server.txt'). |
34 | 34 | echo Server ready. Starting the MAS.... |
35 | 35 | $WAIT > /dev/null # %WAIT% >nul |
36 | 36 |
|
37 | | -xterm -hold -e "$prolog -l $dali_home/active_user_wi.pl --goal utente." & # start /B "" "%prolog%" -l "%dali_home%/active_user_wi.pl" --goal utente. |
| 37 | +$XTERM -hold -e "$PROLOG -l $DALI_HOME/active_user_wi.pl --goal utente." & # start /B "" "%PROLOG%" -l "%DALI_HOME%/active_user_wi.pl" --goal utente. |
38 | 38 | echo Launching agents instances... |
39 | 39 | $WAIT > /dev/null # %WAIT% > nul |
40 | 40 |
|
41 | 41 | # Launch agents |
42 | | -for agent_filename in $build_home/* |
| 42 | +for agent_filename in $BUILD_HOME/* |
43 | 43 | do |
44 | 44 | agent_base="${agent_filename##*/}" |
45 | 45 | echo "Agente: $agent_base" |
46 | | - xterm -e "./conf/makeconf.sh $agent_base $dali_home" & |
47 | | - xterm -T "$agent_base" -hold -e "./conf/startagent.sh $agent_base $prolog $dali_home" & |
| 46 | + $XTERM -e "./conf/makeconf.sh $agent_base $DALI_HOME" & |
| 47 | + $XTERM -T "$agent_base" -hold -e "./conf/startagent.sh $agent_base $PROLOG $DALI_HOME" & |
48 | 48 | sleep 2s |
49 | 49 | $WAIT > /dev/null # %WAIT% >nul |
50 | 50 | done |
|
0 commit comments