Launch was written in C on a DEC Alpha workstation. It is designed to provide an interface to the Single Function Agent System Builder (SiFASyB), as described in the MQP report entitled "Design and Implementation of a Single Function Agent Generator" by Mark Santesson. The project code is DCB9502.
This document explains how to configure and use the launch program. It is assumed that the reader has been exposed to such concepts as agents, agent systems, projects, and clipsifying.
Other User's Guides are available:
USAGE: launch <filename> <Clipsify command> Launch should be run in the same directory as the project data files. <filename> is the name of the project file. It is assumed that a file called "<filename>.bat" exists which was produced by the clipsifier. <Clipsify command> is the name of the Clipsify executable file, including the path to it. This needs to be in absolute form. For example, the address "../../clipsify" would not work, but "/cs1/csugrads1/markts/clipsify" would.Figure C.1: Launch Usage
It is recommended that a script file be created that will invoke the program. The following instructions explain how to do this:
../../code/launch/launch testproj /cs1/csugrads1/markts/code/clipsifyAll the text shown above should be on one line in the file. There cannot be any carriage returns.
The first of the three entries indicates the path to the launch executable program. This starts the launch program.
The second is the name of the project file. It should be in the current directory. This argument tells the launch program what the name of the project file is, so that it can properly start the Clipsifier.
The third is the location of the Clipsifier executable program. This entry must be expressed as shown above, an absolute address from the root directory. To determine what the absolute address of a directory is, change to the directory and type "pwd". This argument is needed so that the Clipsifier can be started. The launch program cannot run the Clipsifier if it doesn't know where the Clipsifier is.
chmod +x launchThis instructs the operating system that the text file "launch" is a script file, and can be executed.
The program is now set up. To run the program, change to the directory where the "launch" script file is located, which should also be the location of the project data files, and type the command "launch". The script file will be executed, which will cause the actual "launch" executable to be started with the appropriate command line arguments.
There must be a separate "launch" script file for every different SiFASyB project that is to be built. If both projects are in the same directory, all parameters will be the same except for the second, which gives the name of the SiFASyB files.
><Command> Send Command to clips !<Command> Execute a shell command Log <file> Send all output to a file Clipsify Clipsify the project Go Start Clips, and load the batch file ? Display this list Quit Exit the launcherFigure C.2: Launch Commands
The "log" command opens a log file. Everything that appears on the screen will be written to the log file. This is useful when debugging. Often, important data will scroll off the screen before it can be read. The log file can be closed either by exiting launch or issuing another "log" command. The log file can be edited just like any other text program.
The "!" character is used to indicate that the rest of the line should be performed as if it was typed at the system shell. For instance, to obtain a list of files in the current directory, type "!ls". Unfortunately, the results will not be entered into the log file if you have opened one. You can edit a file by issuing the command "!edit filename", where "edit" is the name of the editor to use. When editing a file, it is a very good thing that the entire session is not saved in the log file. The log file will register the command to edit the file, but will not show the entire session.
The "clipsify" command is used to run the Clipsifier to translate the project with the name specified when the program was started. The output from the Clipsifier will be displayed on the screen, but if there are a lot of errors, many may scroll off of it before they can be read. In such cases, you should open a log file and then edit it after the Clipsifier is finished. (You may have to close the log file before it is actually written to disk.)
Once a working system has been translated into CLIPS code by the Clipsifier, it can be loaded into CLIPS by using the "go" command. This command starts up the CLIPS interpreter, loads the SiFA system files, and prepares the system for execution.
Once CLIPS has been loaded by using the "go" command, you can send commands to CLIPS by typing the "greater than" character (" > ") before the text to be sent to CLIPS. As a convenience, launch assumes that this command was intended when the first character of a line is the open parenthesis, or "(" character. Since virtually all CLIPS command starts with this character, you can type most CLIPS commands just as you would when directly using the CLIPS interpreter.
When you are done using launch, type "quit", or just "q".
Below is a sample session of someone using launch. The text in italics is entered by the user. For a more thorough explanation of launch as well as other aspects of the SiFASyB, see the MQP report mentioned at the beginning of this guide. % launch
><Command> Send Command to clips !<Command> Execute a shell command Log <file> Send all output to a file Make Remake the Clipsifier Clipsify Clipsify the project Go Start Clips, and load the batch file ? Display this list Quit Exit the launcher: c
CLIPSIFIER> CLIPSIFIER> Project "Test Project" has 4 agents. CLIPSIFIER> CLIPSIFIER> CLIPSIFIER> Processing "Width Selector" with target "WIDTH" CLIPSIFIER> (id 20982, 2 rules, 9 selects, 2 conflict detection methods) CLIPSIFIER> CLIPSIFIER> CLIPSIFIER> CLIPSIFIER> Processing "Depth Selector" with target "DEPTH" CLIPSIFIER> (id 9238, 2 rules, 12 selects, 1 conflict detection methods) CLIPSIFIER> CLIPSIFIER> CLIPSIFIER> CLIPSIFIER> Processing "Maximize area critic" with target "DEPTH" CLIPSIFIER> (id 8948, 0 rules, 0 selects, 1 conflict detection methods) CLIPSIFIER> CLIPSIFIER> CLIPSIFIER> CLIPSIFIER> Processing "Material Selector" with target "MAT" CLIPSIFIER> (id 13100, 0 rules, 6 selects, 1 conflict detection methods) CLIPSIFIER> CLIPSIFIER> CLIPSIFIER> Return state: 256: go
# CLIPS (V6.02 05/05/94) # CLIPS> (batch "testproj.bat") # TRUE # CLIPS> ; Batch loading file for Test Project, by the SiFASyB Clipsifier # # (clear) # CLIPS> (load "testproj.globals") # Defining defglobal: output # TRUE # CLIPS> (load "testproj.templates") # Defining deftemplate: param # Defining deftemplate: pref # Defining deftemplate: accepted # Defining deftemplate: conflict # Defining deftemplate: holding_value # Defining deftemplate: negotiation # Defining deftemplate: negotiation-state # Defining deftemplate: constraint # Defining deftemplate: turn # Defining deftemplate: detect # TRUE # CLIPS> (load "testproj.facts") # Defining deffacts: params # TRUE # CLIPS> (load "testproj.functions") # Defining deffunction: say # Defining deffunction: first # Defining deffunction: second # Defining defrule: print-failure +j # TRUE # CLIPS> (load "width.sel.rules") # Defining defrule: Width_Selector-Init-Target +j+j # Defining defrule: Width_Selector-Init-Target-Cont =j+j # Defining defrule: Width_Selector-SELECT_1 +j+j # Defining defrule: Width_Selector-SELECT_2 =j+j # Defining defrule: Width_Selector-CONFLICT_1 +j+j+j # Defining defrule: Width_Selector-IGNORE_2 =j+j+j+j+j # Defining defrule: Width_Selector-StartNegotiation +j+j+j # Defining defrule: Width_Selector-SetupNegotiation =j+j # Defining defrule: Width_Selector-DontGiveAlternative +j+j+j # Defining defrule: Width_Selector-GiveAlternative =j=j+j+j+j # Defining defrule: Width_Selector-GiveAlternative-Cont +j+j+j+j+j # Defining defrule: Width_Selector-ValueIsGood =j+j+j+j+j+j # Defining defrule: Width_Selector-ValueIsBad =j=j=j=j=j+j # Defining defrule: Width_Selector-ReceiveReject =j+j # Defining defrule: Width_Selector-RequestRelaxation =j+j+j # Defining defrule: Width_Selector-RequestAlternative =j=j+j # Defining defrule: Width_Selector-NoMoreItems =j+j+j+j # Defining defrule: Width_Selector-BothListsEmpty =j+j+j+j # Defining defrule: Width_Selector-ReceiveDontCare =j+j+j+j+j # Defining defrule: Width_Selector-DontRelax =j+j+j # Defining defrule: Width_Selector-GiveRelaxation =j=j+j+j # TRUE # CLIPS> (load "depth.sel.rules") # Defining defrule: Depth_Selector-Init-Target +j+j # Defining defrule: Depth_Selector-Init-Target-Cont =j+j # Defining defrule: Depth_Selector-SELECT_1 +j # Defining defrule: Depth_Selector-SELECT_2 +j # Defining defrule: Depth_Selector-CONFLICT_1 +j+j+j+j # Defining defrule: Depth_Selector-StartNegotiation =j+j+j . . . . . . . . . . # Defining defrule: Depth_Selector-GiveRelaxation =j=j+j+j # TRUE # CLIPS> (load "depth.cri.rules") # Defining defrule: Maximize_area_critic-CONFLICT_1 +j+j+j+j # Defining defrule: Maximize_area_critic-StartNegotiation =j+j+j . . . . . . . . . . # Defining defrule: Maximize_area_critic-GiveRelaxation =j=j+j+j # TRUE # CLIPS> (load "mat.sel.rules") # Defining defrule: Material_Selector-Init-Target +j+j # Defining defrule: Material_Selector-Init-Target-Cont =j+j # Defining defrule: Material_Selector-Default-Selection +j # Defining defrule: Material_Selector-CONFLICT_1 +j+j+j+j # Defining defrule: Material_Selector-StartNegotiation =j+j+j . . . . . . . . . . # Defining defrule: Material_Selector-GiveRelaxation =j=j+j+j # TRUE # CLIPS> (reset) # CLIPS> : (run) # Depth Selector: Initialized DEPTH to 2.0. # # Width Selector: Initialized WIDTH to 2.0. # # Material Selector: Initialized MAT to titanium. # # CLIPS> : (facts) # f-0 (initial-fact) # f-1 (turn (agent nil) (from nil)) # f-2 (pref (agent Width_Selector) (list 0.9 1.1 0.8 1.2 0.7 1.3 1.4 1.5)) # # f-3 (accepted (agent Width_Selector) (list 1.0)) # f-4 (constraint (agent Width_Selector) (value 0)) # f-5 (pref (agent Depth_Selector) (list 1.8 1.6 2.2 1.4 1.2 2.4 1.0 0.8 2 # .6 0.6 0.4)) # f-6 (accepted (agent Depth_Selector) (list 2.0)) # f-7 (constraint (agent Depth_Selector) (value 0)) # f-8 (pref (agent Material_Selector) (list steel iron oak pine plastic)) # f-9 (accepted (agent Material_Selector) (list titanium)) # f-10 (constraint (agent Material_Selector) (value 0)) # f-17 (param (name DEPTH) (owner Depth_Selector) (val 2.0)) # f-19 (param (name WIDTH) (owner Width_Selector) (val 2.0)) # f-22 (param (name MAT) (owner Material_Selector) (val titanium)) # For a total of 14 facts. # CLIPS>: (exit) : (exit)
Clips process not started. Use the "Go" command.: q
For more information on the Launch program, consult the MQP report referenced at the beginning of this document.
User's Guides are available for the other two components of SiFASyB:
Written by: email@example.com
firstname.lastname@example.org / Aug 6, 1996