Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## sim.engine
Class MultiStep

    java.lang.Object
      sim.engine.MultiStep

All Implemented Interfaces:
  java.io.Serializable, Steppable

    public class MultiStep

extends java.lang.Object
implements Steppable

MultiStep takes an integer N, a boolean called countdown, and a steppable. EITHER the subsidiary steppable is stepped N times for each MultiStep.step(...), OR the subsidiary steppable is stepped once every N MultiStep.step(...) calls. The second one occurs if countdown is set to true. If N is <=0, then the subsidiary steppable is never stepped no matter what.

The count down (if we're doing that) can be reset by calling resetCountdown(). MultiStep is properly synchronized.

If you're using MultiStep to schedule an agent to occur repeating over time, you'd probably do better to use Schedule.scheduleRepeating(...) instead.

See Also:
  Serialized Form

Constructor Summary
`MultiStep(Steppable step, int n, boolean countdown)` If countdown is true, then we call step.step(...) once every N times we're stepped.

Method Summary
`void` | `resetCountdown()` If we're counting down, then this resets the countdown.
`void` | `resetCountdown(int val)` If we're counting down, then this resets the countdown to the given value, which should be > 0 and <= n.
`void` | `step(SimState state)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### MultiStep

    public MultiStep(Steppable step,
                     int n,
                     boolean countdown)

  If countdown is true, then we call step.step(...) once every N times we're stepped. if countdown is false, then we call step.step(...) N times every time we're stepped.

Method Detail

### resetCountdown

    public void resetCountdown()

  If we're counting down, then this resets the countdown.

### resetCountdown

    public void resetCountdown(int val)

  If we're counting down, then this resets the countdown to the given value, which should be > 0 and <= n. Note that if n = 0, this method has no valid value you can pass in.

### step

    public void step(SimState state)

  Specified by:
    `step` in interface `Steppable`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD