An empty KB contains a set of installed system tables and one or more G2-window items, as illustrated in this figure:
![]() |
When a new G2 process starts, G2 initializes all attributes of all system-defined items to their default values.
Tip: You can customize the attributes of the system tables in an empty KB, then save the empty KB to a file. When you next load this KB file, you restore those customized settings, for use in developing new knowledge in the KB.
Clearing the Current KB
Sometimes, it might be necessary to clear the contents of the current KB. For example, if you have loaded an existing KB, add items to it, and later decide you want to revert to the saved version, you might want to clear the KB.
To clear the current KB:
Select Main Menu > Miscellany > Clear KB.
To start the current KB:
Select Main Menu > Start.
You can still create items and interact with them in most ways when a KB is paused. However, certain interactions are restricted when a KB is paused.
Once you have paused a KB, you can resume running it to continue execution. You can pause a KB interactively or programmatically. You can only resume a KB interactively.
To pause the current KB interactively:
Select Main Menu > Pause.
To pause the current KB programmatically:
Execute the pause knowledge-base action.
To resume a paused KB:
Select Main Menu > Resume.
To reset the current KB interactively:
Select Main Menu > Reset.
To reset the current KB programmatically:
Execute the reset knowledge-base action.
Main Menu > Reset, then selecting Main Menu > Start, in succession.
To restart the current KB:
Select Main Menu > Restart.
The next table summarizes how menu choices on the
Main Menu affect the current KB run-state:
G2 displays only the
Main Menu choices that are valid for the current run-state. For instance, if the current KB is paused, the Main Menu displays the Restart, Resume, and Reset choices, but not the Start and Pause choices. Main Menu choices that transition between run-states.
![]() |
The Initial/Reset Run-State
In the initial/reset run-state, a KB is ready for running. In this run-state, you can interactively change all knowledge in the KB.
From the initial/reset run-state, a KB can transition only to the running run-state.
The Running Run-State
In the running run-state, G2 is performing the tasks specified in the current KB. G2 detects events that occur in real time, performs actions specified in rules, executes procedures, seeks data for variables, and so on. G2 performs these tasks as a series of operations dispatched and controlled by the scheduler, as described in Chapter 46, Task Scheduling.
When the KB is running, it can contain both updated permanent knowledge and transient knowledge. Transient knowledge consists of a KB's transient items and the transient information associated with permanent items. For a description of transient items and the transient information associated with permanent items, see Chapter 10, G2 Items.
From the running run-state, a KB can transition to the initial/reset run-state or to the paused run-state.
The Paused Run-State
In the paused run-state, G2 suspends the execution of all tasks specified by the KB. G2 retains all information about updated permanent and transient knowledge. When in this state, you can resume running, at which time G2 continues performing suspended tasks. Summary of Run-States
For each part of a KB's knowledge, the following table summarizes its condition under each run-state:
The G2 Simulator, which can provide simulation values and simulation histories, is a superseded capability. For more information, see Appendix F, Superseded Practices.