ContactCenters
V. 0.9.9.

umontreal.iro.lecuyer.contactcenters.server
Class AfterContactTimeGenerator

java.lang.Object
  extended by umontreal.iro.lecuyer.contactcenters.server.AfterContactTimeGenerator
All Implemented Interfaces:
Initializable, ValueGenerator

public class AfterContactTimeGenerator
extends Object
implements ValueGenerator

Value generator for the after-contact time of contacts. This implementation simply calls the Contact.getDefaultAfterContactTime() method to get the after contact times. For each new agent group, such a value generator is created and used by default.


Constructor Summary
AfterContactTimeGenerator(AgentGroup group)
          Constructs an after-contact time generator returning the same after-contact time for each contact type.
AfterContactTimeGenerator(AgentGroup group, double[] mult)
          Constructs a new after-contact time generator with a different multiplier for each contact type.
 
Method Summary
 AgentGroup getAgentGroup()
          Returns the reference to the associated agent group.
 double[] getMultipliers()
          Returns the vector of multipliers for this after-contact time generator.
 void init()
          Initializes the generator at the beginning of the simulation.
 double nextDouble(Contact contact)
          Generates and returns a new value for the contact contact.
 void setAgentGroup(AgentGroup group)
          Sets the associated agent group to group.
 void setMultipliers(double[] mult)
          Sets the after-contact time multiplier for each contact type to mult.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AfterContactTimeGenerator

public AfterContactTimeGenerator(AgentGroup group)
Constructs an after-contact time generator returning the same after-contact time for each contact type.

Parameters:
group - the associated agent group.

AfterContactTimeGenerator

public AfterContactTimeGenerator(AgentGroup group,
                                 double[] mult)
Constructs a new after-contact time generator with a different multiplier for each contact type. When an after-contact time is required for a contact of type k, the result of Contact.getDefaultAfterContactTime() is multiplied by mult[k].

Parameters:
group - the associated agent group.
mult - the vector of after-contact time multipliers.
Method Detail

getMultipliers

public double[] getMultipliers()
Returns the vector of multipliers for this after-contact time generator. For contact type k, the multiplier of the after-contact times is given by the element with index k in the array. If this returns null, after-contact times all have multiplier 1.

Returns:
the vector of after-contact times multipliers.

setMultipliers

public void setMultipliers(double[] mult)
Sets the after-contact time multiplier for each contact type to mult.

Parameters:
mult - the new vector of after-contact times multipliers.

getAgentGroup

public AgentGroup getAgentGroup()
Returns the reference to the associated agent group.

Returns:
the associated agent group.

setAgentGroup

public void setAgentGroup(AgentGroup group)
Sets the associated agent group to group.

Parameters:
group - the new associated agent group.

init

public void init()
Description copied from interface: ValueGenerator
Initializes the generator at the beginning of the simulation.

Specified by:
init in interface Initializable
Specified by:
init in interface ValueGenerator

nextDouble

public double nextDouble(Contact contact)
Description copied from interface: ValueGenerator
Generates and returns a new value for the contact contact. If contact is null and this is not allowed by the implementation, this method should throw a NullPointerException.

Specified by:
nextDouble in interface ValueGenerator
Parameters:
contact - the contact being concerned.
Returns:
the generated value.

toString

public String toString()
Overrides:
toString in class Object

ContactCenters
V. 0.9.9.

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