A switch enables you to turn things on or off in a model. When you add a switch to your model, you can assign it to control one or more converters, to a sector, to a module, or to turn on/off the current settings in the Sensitivity Specs dialog box. Use the switch to create a user-friendly device that allows model users to control aspects of a model.
The following table provides an overview of what you can assign to a switch and what happens when the switch is turned on or off. For more details, see Switch dialog box.
When the switch is on | When the switch is off | |
---|---|---|
Converter | The associated converter's value is 1 | The associated converter's value is 0 |
Sector | The Run Sector(s) command is available and runs the sector associated with the switch | The associated sector does not run when the command is used |
Module | The Run Module(s) command is available and runs the module associated with the switch | The associated module does not run when the command is used |
Sensitivity Analysis | The next run will use the current sensitivity specs | The model runs in normal, single-run mode |
If you select to associate a switch with converters, you can create a special type of switch, called the "chained switch". A chained switch allows you to turn on one entity while simultaneously turning off all other entities in the chain. When you create a chained switch, you can select up to ten converters to include in the chain.
The following procedures describe how to add a switch to your model, how to define the switch (including creating a chained switch), and how to turn switches on and off.
Note: You can add a switch only on the Interface layer.
To specify the properties for the switch, double-click the switch icon, or right-click the switch icon and then choose Open from the menu that appears.
The Switch dialog box opens.
Use the options in the Switch dialog box to define the properties of the switch. For more information, see To define a switch.
For more information about placing and editing switches, see Working with objects.
Notes: You cannot resize a switch.
You can select to have the name of the associated entity displayed next to the switch, but you cannot otherwise define or edit the switch's name.
Open the Switch dialog box for the switch that you want to define.
Select whether you want to use a Toggle or Push Button switch.
For Converters, Sectors, or Modules , select the entity that you want to associate with the switch.
Tip: You can also add an entity to switch by dragging it from the Find palette.
Converters that are associated with a switch display a small switch icon to help remind you that the model logic is being overridden by a switch.
Select the Push Button option.
Select up to 10 converters from the "Allowable" list.
Converters that are associated with a switch display a small switch icon to help remind you that the model logic is being overridden by a switch.
The procedure for turning on or off a switch depends on how you have defined the switch:
For toggle switches, when the switch is in the down position, it is off; when it is in the up position, it is on. To turn the switch on or off, click the round handle at the tip of the switch. When the switch is on, the small square in the center of the switch turns green.
For push button switches, click the switch to turn it on or off. When the switch is on, the small square in the center of the switch turns green.
For chained switches, click the switch that you want to turn on or off. When switches are chained, turning on one switch turns off the other switches in the chain.
Tip: To turn off all switches in the model use the Restore > Switches command on the Interface and Model menus.