Global variables
Global variables are rarely used in user code, but several are provided for use under certain circumstances. The cs* variables are used when handling the event calendar, and starting and stopping the Scheduler. The ssgvar variable is the root of all system scheduler data structures. These variables are presented in alphabetical order. For each variable, there is a brief description, the type of variable, and notes about its use.
Variable | Description | Type | Notes |
---|---|---|---|
cscln0 | Variable cscln0 is the list of internal scheduler events, often called the internal event calendar. | CSLIST *cscln0; | This list should be accessed using the special functions intended for that purpose, rather than standard list functions, whenever possible. |
csclnr | Variable csclnr is the list of regular scheduler events, often called the regular event calendar. | CSLIST *csclnr; | This list should be accessed using the special functions intended for that purpose, rather than standard list functions, whenever possible. |
cshalt | Variable cshalt is the scheduler halt flag. Normally this flag is set to false (zero). If it is set to a true (non-zero) value during the processing of an event, the scheduler will terminate immediately after that event returns. | int cshalt; | This variable is not normally used from user-written code but may be useful if the end of the scheduler is dictated by events other than the end of the scheduling window or the completion of the last order. |
cstbeg | Variable cstbeg is the beginning time of the scheduler, in hours, from time zero. | double cstbeg; | Currently, the scheduler always starts at time zero. Therefore, this value is always zero. |
cstfin | Variable cstfin is the ending time of the scheduler, in hours, from the start of the scheduler. | double cstfin; | Currently this value is the difference, in hours, between the start and end of the scheduler or, in other words, the length of the scheduler in hours. |
cstnow | Variable cstnow is the current scheduler time, in hours, from the start of the scheduler. | double cstnow; | This is the elapsed time, in hours, since the start of the scheduler. |
ssgvar | Variable ssgvar is the main system global data structure. It contains, through substructures and lists, the entire system model. This data structure is quite complex; therefore, see the include file “factor.h” for a complete description of its members. | SSGLOBL ssgvar; | See note below. |
Note: Major components of ssgvar: sgctrl - Global
scheduler control data structure (i.e., scheduler start times, trace
information, etc.) and system output data collection flags and dataset numbers.
sgflg - Structure for system specific output data collection flags and dataset
numbers. global lists - Lists of all components in the scheduler model. hash
tables - Hash tables for data input. misc. controls - Various global values
used by the scheduler. For example, sgestfg is the estimate processing time
flag used by random variable functions to signal them to return the mean of the
distribution, if estimating.