# File : soar.soar # Usage: When placed in the same directory as the MacSoar executable, this file is # automatically executed when MacSoar is run. ## This has to be done in soar.soar ## Set up the directories for later use ## on the mac if {[string first "/" [pwd]]!=0} { output-strings-destination -push -append-to-result set soar_dir [pwd] output-strings-destination -pop set soar_library $soar_dir:library set soar_help $soar_dir:doc:text:soar } ## not on the mac if {[string first "/" [pwd]]==0} { output-strings-destination -push -append-to-result set soar_dir [pwd] output-strings-destination -pop set soar_library $soar_dir:library set soar_help $soar_dir:doc:text:soar } # soar_root is a globally defined variable in MacSoar and used here. # demo_root and gui_root are defined locally only. global soar_root set demo_root $soar_root:demos:no-gui set gui_root $soar_root:demos:gui echo "============== executing soar.soar ==============="; echo " " # An alias is defined to execute a demo program using a single command. # Without the use of the eval command, tcl will interpret the string of commands # as a single instruction, becoming hopelessly confused. However, eval does not # automatically recognize global variables, so those used by the demos must be # explicitly referenced using the global command. # The analogy demo does not currently function properly for MacSoartk due # to a problem with user input. # #echo "Type \"analogy\" to execute the analogy demo" #alias analogy eval "global default warnings; # excise -all; # source \"$demo_root:analogy:analogy.soar\"; # run" echo "Type \"blocks\" to execute the blocks world demo" alias blocks eval "global default warnings; excise -all; source \"$demo_root:blocks-world:blocks-world.soar\"; run" echo "Type \"8puzzle\" to execute the eight puzzle demo" alias 8puzzle eval "global default warnings; excise -all; source \"$demo_root:eight_puzzle:eight_puzzle.soar\"; run" echo "Type \"farmer\" to execute the farmer demo" alias farmer eval "global default warnings; excise -all; source \"$demo_root:farmer:farmer.soar\"; run" echo "Type \"kab\" to execute the kab demo" alias kab eval "global default warnings; excise -all; source \"$demo_root:kab:kab.soar\"; run" echo "Type \"mission\" to execute the missionaries demo" alias mission eval "global default warnings; excise -all; source \"$demo_root:missionaries:missionaries.soar\"; run" echo "Type \"jug\" to execute the waterjug demo" alias jug eval "global default warnings; excise -all; source \"$demo_root:waterjug:waterjug.soar\"; run" echo "Type \"8gui\" to execute the eight puzzle gui demo" alias 8gui eval "global default warnings; excise -all; cd \"$gui_root:eight_puzzle\"; source eight_puzzle.tcl; cd " echo "Type \"critter\" to execute the critter world demo" alias critter eval "global default warnings; excise -all; cd \"$gui_root:critter_world\"; source critter_world.tcl; cd " echo " " echo "=================================================="; echo " " cd tsi-pcm source tsi.tcl # The following added specifically for the PST.v12, RMY 3.1.98 tsi cd ../../PST.v12 chunk-name-format -short