ContactCenters
V. 0.9.9.

umontreal.iro.lecuyer.contactcenters.server
Class ContactTimeGenerator

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

public class ContactTimeGenerator
extends Object
implements ValueGenerator

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


Constructor Summary
ContactTimeGenerator(AgentGroup group)
          Constructs a contact time generator returning the same contact time for each contact type.
ContactTimeGenerator(AgentGroup group, double[] mult)
          Constructs a new 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 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 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

ContactTimeGenerator

public ContactTimeGenerator(AgentGroup group)
Constructs a contact time generator returning the same contact time for each contact type.

Parameters:
group - the associated agent group.

ContactTimeGenerator

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

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

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.

getMultipliers

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

Returns:
the vector of contact times multipliers.

setMultipliers

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

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

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.