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

## umontreal.iro.lecuyer.contactcenters.msk.model
Class ShiftEvent

    java.lang.Object
      umontreal.iro.lecuyer.simevents.Event
          umontreal.iro.lecuyer.contactcenters.msk.model.ShiftEvent

All Implemented Interfaces:
  Comparable<Event>

    public class ShiftEvent

extends Event

Represents a simulation event adding agents to a group at the beginning of working parts of a shift, and removing them at the end of working parts. The agents to be added or removed are stored into an internal array of `Agent` objects so the agents are reused from parts to parts of a given shift.

Field Summary

Fields inherited from class umontreal.iro.lecuyer.simevents.Event
`eventTime, priority, sim`

Constructor Summary
`ShiftEvent(DetailedAgentGroup group, Agent[] agents, ScheduleShift shift)` Similar to `ShiftEvent(DetailedAgentGroup,ScheduleShift)`, except that the agents in array `agents` are added and removed to the group rather than an array of new `Agent` objects.
`ShiftEvent(DetailedAgentGroup group, ScheduleShift shift)` Constructs a new shift event managing agent group `group`, and using information in shift `shift`.

Method Summary
`void` | `actions()`
`void` | `init(RandomStream stream, double mult)` Initializes this event with a new multiplier `mult`, and resets the internal part index.
`void` | `schedule()` Schedules this event to occur at the next time it is needed to add or remove the associated agents from the attached group.

Methods inherited from class umontreal.iro.lecuyer.simevents.Event
`cancel, cancel, compareTo, getRa, priority, reschedule, schedule, scheduleAfter, scheduleBefore, scheduleNext, setPriority, setRa, setSimulator, setTime, simulator, time`

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

Constructor Detail

### ShiftEvent

    public ShiftEvent(DetailedAgentGroup group,
                      ScheduleShift shift)

  Constructs a new shift event managing agent group `group`, and using information in shift `shift`.

  Parameters:
    `group` - the agent group to which agents are added and removed.
    `shift` - the shift used to determine the number of agents and working parts.

### ShiftEvent

    public ShiftEvent(DetailedAgentGroup group,
                      Agent[] agents,
                      ScheduleShift shift)

  Similar to `ShiftEvent(DetailedAgentGroup,ScheduleShift)`, except that the agents in array `agents` are added and removed to the group rather than an array of new `Agent` objects.

Method Detail

### init

    public void init(RandomStream stream,
                     double mult)

  Initializes this event with a new multiplier `mult`, and resets the internal part index. This method gets the number of agents on the associated shift, multiplies this number with `mult`, and rounds the result to the nearest integer; this gives the effective number of agents on the shift. The method then creates or updates an internal array of `Agent` objects which are added and removed from the associated group each time the event occurs. The array of agents is created or updated only if it does not exist yet, or if its length does not correspond to the effective number of agents on the shift.

  Parameters:
    `stream` - a random stream used to generate the number of agents when it is random.
    `mult` - the multiplier for the number of agents.
  Throws:
    `IllegalArgumentException` - if `mult` is negative.

### schedule

    public void schedule()

  Schedules this event to occur at the next time it is needed to add or remove the associated agents from the attached group. If the simulation time is greater than the ending time of the last part of the shift, the event is not scheduled anymore. The method `init(RandomStream,double)` can be used to reset the event.

### actions

    public void actions()

  Specified by:
    `actions` in class `Event`

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

To submit a bug or ask questions, send an e-mail to Richard Simard.