A simulation control class defines how the simulator is invoked and executed. There are two types of simulation controls supported by SansGUI:
In-Process Simulation Control: for executing the simulator in a thread within the same process space of SansGUI. The data objects are shared by SansGUI and the simulator. Because SansGUI controls the flow of simulator execution, it provides users with a highly interactive environment for manipulating the simulation run, such as being able to pause, plot results, modify data, and resume the simulation. SansGUI currently supports Cycle simulation for in-process simulation control. More control paradigms will be added in future releases.
External Process Simulation Control: for executing the simulator in a process outside of the SansGUI process. A textual Model File will be written for the data and configuration of the model and a command script will be used to invoke the simulator as an external program.
The two types of simulation controls are not mutually exclusive. You can decide to provide simulators for both of them, so that the users can run the simulator either in a highly interactive session or as a long process during off-hours. For more details and semantics behind the simulator controls, please consult the SansGUI Simulation Control chapter in the SansGUI Reference Manual.
To indicate which simulation control mechanism to use, all one has to do is to create a subclass from one of the intrinsic simulation control classes. To create the simulation control subclass:
Make sure that you have created a Schema Definition and entered its simulator identification, as described in the previous sections in this chapter.
Locate the simulation control class, such as Cycle or XProc, from the root class SimControl under the Simulator tab in the Tree View.
Right click on the name or icon of the simulation control class to obtain a context menu.
From the context menu, select the Create Subclass menu item. If it is disabled, the simulation control has been defined and is incompatible with the class you select. You will have to delete the conflicting simulation control class before you can create a new one.
After selecting the Create Subclass menu item, a Class Properties dialog will be displayed for the newly created class. Enter the name of the class. Normally, we use the same name as the simulator's program name, but this is not a requirement.
Change the class icon, if desired. To change the icon, click on the Change Icon... button to select a new icon. Details can be found in the previous section -- Accessing Class Properties.
Once you have set the name and, optionally, the class icon, click on the OK button to add the simulation control class to the Schema Definition.
The version number of the simulation control class that you created decides the version number of the simulator. Each time you build an Object Library, the version number of the simulation control will be incremented according to the operation you chose. Unlike the version numbers of other classes, which will be incremented only when there is a change in the class schema, the version number of the simulation control class will always be incremented during the Object Library generation process. Your simulator's version number should be synchronized with the version number of the simulation control class in the generated Object Library. The Class Schema Version Control mechanism is described with further details in Chapter 1.
In addition to the attributes inherited from the intrinsic simulation control class, you can add a custom set of attributes to your simulation control class. Because the data object of the simulation control class will be passed as a parameter in each of the SansGUI API calls during run time, it is possible to access and update the data values in it when evaluating all system objects and parts. Thus, the attributes in the simulation control class can be treated as global variables. Similar to other programming practices, you should limit the use of global variables to as few as possible.
Entering global attributes to the simulation control class is actually the same as entering attributes to all other classes. See the Adding Attributes to Classes section for more details.
SansGUI Modeling and Simulation Environment Version 1.2
Copyright © 2000-2003 ProtoDesign, Inc. All rights reserved.