cyclic Behavior
Declares a behavior that the library repeats: block is one cycle, run again as soon as it ends, from time 0 of every replication. This is the usual form of a resource's own behavior, such as a break taken every so often:
doctor.cyclicBehavior {
delay(120.0)
doctor.goOffShift()
delay(15.0)
doctor.goOnShift()
}
Anything a process can do is allowed in the block, including seizing this resource, which then waits in its queue like any customer. The behavior belongs to the resource as a whole, however large its capacity: one process, not one per unit.
The block is called afresh for every cycle, so its local variables last one cycle. A variable outside it, such as a property of the model, keeps its value from one replication to the next: state carried from cycle to cycle lives outside the block and is reset in the model's initialize, or the behavior is a behavior that loops itself and keeps the state local, giving up the stop after the current cycle and the check against a cycle that never waits.
More than maxCyclesPerInstant cycles in a row that end at the time they began throw, naming this resource: such a cycle never waits. Use stopBehavior and startBehavior to switch the behavior off and on during a replication, onBehaviorStopped to put back what a stopped behavior changed, and behaviorActiveAtStart to decide whether each replication starts it. A resource has at most one behavior, of either form, declared while the model is not running.
Parameters
one cycle of the behavior