Next: Methods of the LogicalProcess
Up: Data of the LogicalProcess
Previous: simArray
The lpIdle flag in the LogicalProcess class is defined as an
instance of OneShot<bool> type. The template class
OneShot<class foo> instantiates a foo internally and mimics the
foo class in all respects; all of the operators are defined to
operate just like the foo's operators. However, the class
OneShot adds two methods to the foo class, called reset and
didItChange. When the method didItChange is invoked, it
returns a boolean whose value indicates whether or not its value has
changed since the last time reset was accessed. Once a new value is
assigned to the foo instantiated inside the OneShot,
didItChange will return true until reset is called again -
hence the name OneShot.
The lpIdle is used to indicate when the LogicalProcess is
completely idle. The definition of completely idle for an LP is that
- All of its simulation objects are idle. For a simulation object to be
idle, it has to have no unprocessed events in its queue.
-
The GVTManager has no messages that it is waiting for
acknowledgment on. This means that GVTManager::needAcked.size ==
0.
Since it is impossible for the LP to know if any messages for it are in
transit, these conditions are sufficient only to tell if it is
idle. The problem of determining if the entire simulation is idle is
discussed in the section on termination.
Next: Methods of the LogicalProcess
Up: Data of the LogicalProcess
Previous: simArray
Philip A. Wilsey
1/26/1998