Running a simulation

To perform a simulation of an L-system model, select Go! from the Cpfg or Lpfg menu. (Only one of these menus will be present, depending on whether the current object is a cpfg or lpfg object.) L-studio will then update all of the lab table files that are needed by the simulation program:

and, if present,

L-studio then runs the cpfg or lpfg simulation program.

Changing the model

After cpfg/lpfg has been launched, you may edit any components of the object (e.g. the L-system, view file, color map, etc.). To apply the changes to the simulator, you have two options:

Closing the simulator

cpfg/lpfg and the message log window will remain open until you either:

For detailed information on the use of cpfg see the Cpfg User's Manual. For detailed information on lpfg, see the Lpfg User's Manual.

The specifications file

Under vlab, the special file specifications is used to describe an object and all of the operations which can be performed on it. (See the vlab documentation.) L-studio performs the same function using file extensions; however, to maintain compatibility, L-studio is capable of running objects containing a specifications file. If the object contains such a file, L-studio tries to do the following:

  1. Find a line that starts with letters cpfg. (These letters might be preceded by blank characters).
  2. If the string cpfg is followed by some other characters (e.g. cpfg3.4) then the additional characters are skipped.
  3. Check if the line contains -m or -M. If it doesn't then -m followed by the name of the colormap file present in the object is inserted. (Explanation: In the original SGI-IRIX version of cpfg, it is possible to instruct cpfg to use a colormap maintained by the windowing system, rather than by cpfg itself. This mechanism is not available in the Windows version, so cpfg must handle its own colormap.)
  4. Call cpfg using this command line.

Important: this mechanism, while useful, might also cause some problems if the command line in the specifications file contains some UNIX-specific commands, such as calling more than one program (e.g. cpfg plant.l plant.v &; tail -F cpfg.out) or stream redirection (cpfg plant.l plant.v > dump.txt). L-studio passes the entire command line to cpfg, which will not start with incorrect parameters.

The LSspecifications file

The special file LSspecifications holds object-specific L-studio preferences. If there is an LSspecifications file present in the object, L-studio will look for a line which starts with the string "cpfg" or "lpfg". The text following this string is assumed to be the command line for the simulation program. The simulation program will be called with the parameters specified in this line. The menu label (Cpfg or Lpfg) shows which program was read from the LSspecifications when the object was loaded or the LSspecifications file was last saved.

If the object contains neither LSspecifications nor specifications files, or if one or both exist, but don't contain a line starting with "cpfg" or "lpfg", then the following algorithm is used to generate command line parameters for the simulation program:

The simulation program is assumed to be cpfg, with parameters

If there is a *.e file in the object directory then the parameters will be:

A full description of cpfg's command line parameters is given in the Cpfg User's Manual.

When the cpfg/lpfg window has appeared, a log window appears immediately below it to display any messages the simulator generates.