12.1 The Basic Features of all Processes

The base Process class provides the following variables for controlling its behavior:

Enum type
This can be either C_CODE or SCRIPT, which determines if the Process is going to execute C code or CSS script code. A script file must be attached to the process to run in SCRIPT mode.
Modulo mod
This object controls how often a process is run. It is applicable for processes and statistics that are placed in either the loop_procs or loop_stats groups of a scheduling process, and the modulo function is based on the counter variable of that parent process. For final_stats and final_procs, the counter variable is that of the parent of the parent schedule process. If the flag variable of the mod object is not set then the process is never run. Otherwise the process is run if the parent's counter minus the off variable modulo the m variable is equal to zero (i.e., it is run every m times, with a phase determined by the offset off).
Network* network
This is a pointer to the Network object on which the Process is acting. This pointer is copied automatically from the parent process, so it should be changed only at the highest level of the processing hierarchy, which will cause it to change in all the lower-level processes.
Environment* environment
This is a pointer the Environment in which the Process acts. Like the network pointer, it is automatically copied from higher-level processes, and should be set at the highest level.

The basic Process class provides the following functions for controlling its behavior. Some of these are available on the Control Panel buttons that appear at the bottom of the edit dialog and the control panel, and others are in the Actions menu.

NewInit()
Initializes the process using new random seed. This seed is saved, and can be recalled using the ReInit function, but the previously saved seed is then lost.
ReInit()
Initializes the process using the previously-saved random seed.
Run()
This function checks which type of code the Process is supposed to use (C code or script) and executes the appropriate code.
Step()
Executes one step the process.
Stop()
Stops the process when running.
ControlPanel()
Brings up a small control panel dialog for running the process.
LoadScript (char* filename)
Sets the script file to be used by the Process to filename and compiles the script for execution. This function clears any previous script file being used by the process. It automatically sets the type variable to SCRIPT.