ContactCenters
V. 0.9.9.

umontreal.iro.lecuyer.contactcenters.contact
Class SingleTypeContactFactory

java.lang.Object
  extended by umontreal.iro.lecuyer.contactcenters.contact.SingleTypeContactFactory
All Implemented Interfaces:
ContactFactory
Direct Known Subclasses:
CallFactory

public class SingleTypeContactFactory
extends Object
implements ContactFactory

Represents a contact factory used to create contacts of a single type. This factory also associates default patience, contact, and after-contact times to the constructed contacts. All random variates are generated at the time the contact is created.


Constructor Summary
SingleTypeContactFactory(int type, ValueGenerator probBalkGen, RandomStream streamBalk, RandomVariateGen pgen, RandomVariateGen cgen, RandomVariateGen[] cgenGroups, RandomVariateGen acgen, RandomVariateGen[] acgenGroups)
          Constructs a new contact factory constructing contacts of type type.
SingleTypeContactFactory(Simulator sim, int type, ValueGenerator probBalkGen, RandomStream streamBalk, RandomVariateGen pgen, RandomVariateGen cgen, RandomVariateGen[] cgenGroups, RandomVariateGen acgen, RandomVariateGen[] acgenGroups)
          Equivalent to SingleTypeContactFactory(int,ValueGenerator,RandomStream,RandomVariateGen,RandomVariateGen,RandomVariateGen[],RandomVariateGen,RandomVariateGen[]), using the given simulator sim.
 
Method Summary
 RandomVariateGen getAfterContactTimeGen()
          Returns the random-variate generator for default after-contact times.
 RandomVariateGen getAfterContactTimeGen(int i)
          Returns the random variate generator for contacts served by agents in group i.
 RandomVariateGen[] getAfterContactTimeGenGroups()
          Returns the random variate generators for after-contact times when served by agents in specific groups.
 RandomVariateGen getContactTimeGen()
          Returns the random-variate generator for default contact times.
 RandomVariateGen getContactTimeGen(int i)
          Returns the random variate generator for contacts served by agents in group i.
 RandomVariateGen[] getContactTimeGenGroups()
          Returns the random variate generators for contact times when served by agents in specific groups.
 double getMeanAfterContactTime(int i)
          Returns the mean after-contact time for a new contact served by an agent in group i.
 double getMeanContactTime(int i)
          Returns the mean contact time for a new contact served by an agent in group i.
 RandomVariateGen getPatienceTimeGen()
          Returns the random-variate generator for patience times.
 ValueGenerator getProbBalkGenerator()
          Returns a reference to the value generator used for generating probabilities of balking.
 RandomStream getStreamBalk()
          Returns the random stream used for balking.
 int getTypeId()
          Returns the type identifier for contacts returned by this factory.
 Contact newInstance()
          Creates a new instance of class Contact, and initializes it by calling the setRandomVariables(Contact) method.
 void setAfterContactTimeGen(RandomVariateGen acgen)
          Sets the random variate generator for default after-contact times to acgen.
 void setAfterContactTimeGenGroups(RandomVariateGen[] acgenGroups)
          Sets the contact-time generators for contacts served by specific agent groups to cgenGroups.
 void setContactTimeGen(RandomVariateGen cgen)
          Sets the random variate generator for default contact times to cgen.
 void setContactTimeGenGroups(RandomVariateGen[] cgenGroups)
          Sets the contact-time generators for contacts served by specific agent groups to cgenGroups.
 void setPatienceTimeGen(RandomVariateGen pgen)
          Sets the random variate generator for patience times to pgen.
 void setProbBalkGenerator(ValueGenerator probBalkGen)
          Sets the value generator for probability of balking to probBalkGen.
 void setRandomVariables(Contact contact)
          Generates the random variates related to a contact, and assigns the generated value to the given contact object.
 void setSimulator(Simulator sim)
          Sets the simulator associated with this contact factory to sim.
 void setStreamBalk(RandomStream streamBalk)
          Sets the random stream used for balking to streamBalk.
 void setTypeId(int type)
          Sets the type identifier of constructed contacts to type.
 Simulator simulator()
          Returns the simulator associated with this contact factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleTypeContactFactory

public SingleTypeContactFactory(int type,
                                ValueGenerator probBalkGen,
                                RandomStream streamBalk,
                                RandomVariateGen pgen,
                                RandomVariateGen cgen,
                                RandomVariateGen[] cgenGroups,
                                RandomVariateGen acgen,
                                RandomVariateGen[] acgenGroups)
Constructs a new contact factory constructing contacts of type type. The probBalkGen value generator is used to generate probabilities of balking while streamBalk is used to determine if the contact balks if not served immediately. The generators pgen, cgen, and acgen are used to generate patience times for contacts that do not balk, contact times, and after-contact times. cgenGroups and acgenGroups can be used to generate contact and after contact times used if the contact is served by a specific agent group.

If probBalkGen or streamBalk are null, the probability of balking will always be 0. If pgen is null, the patience time will always be infinite. The default contact time when the given generator is null is infinite while the default after-contact time is 0.

The constructed call factory assigns the default simulator returned by Simulator.getDefaultSimulator() to each new contact.

Parameters:
type - the contact type identifier of all new contacts.
probBalkGen - the generator for balking probabilities.
streamBalk - the random stream for balking.
pgen - the patience time generator.
cgen - the default contact time generator.
cgenGroups - the agent-group specific contact time generators.
acgen - the default after-contact time generator.
acgenGroups - the agent-group specific after-contact time generators.

SingleTypeContactFactory

public SingleTypeContactFactory(Simulator sim,
                                int type,
                                ValueGenerator probBalkGen,
                                RandomStream streamBalk,
                                RandomVariateGen pgen,
                                RandomVariateGen cgen,
                                RandomVariateGen[] cgenGroups,
                                RandomVariateGen acgen,
                                RandomVariateGen[] acgenGroups)
Equivalent to SingleTypeContactFactory(int,ValueGenerator,RandomStream,RandomVariateGen,RandomVariateGen,RandomVariateGen[],RandomVariateGen,RandomVariateGen[]), using the given simulator sim.

Method Detail

simulator

public Simulator simulator()
Returns the simulator associated with this contact factory. This simulator is associated with every contact instantiated by the factory.

Returns:
the associated simulator.

setSimulator

public void setSimulator(Simulator sim)
Sets the simulator associated with this contact factory to sim.

Parameters:
sim - the new associated simulator.

newInstance

public Contact newInstance()
Creates a new instance of class Contact, and initializes it by calling the setRandomVariables(Contact) method.

Specified by:
newInstance in interface ContactFactory
Returns:
the new contact object.

setRandomVariables

public void setRandomVariables(Contact contact)
Generates the random variates related to a contact, and assigns the generated value to the given contact object.

Parameters:
contact - the contact object to set up.

getStreamBalk

public RandomStream getStreamBalk()
Returns the random stream used for balking.

Returns:
the random stream used for balking.

setStreamBalk

public void setStreamBalk(RandomStream streamBalk)
Sets the random stream used for balking to streamBalk.

Parameters:
streamBalk - the new random stream for balking.

getProbBalkGenerator

public ValueGenerator getProbBalkGenerator()
Returns a reference to the value generator used for generating probabilities of balking.


setProbBalkGenerator

public void setProbBalkGenerator(ValueGenerator probBalkGen)
Sets the value generator for probability of balking to probBalkGen.


getPatienceTimeGen

public RandomVariateGen getPatienceTimeGen()
Returns the random-variate generator for patience times.

Returns:
the random variate generator for patience times.

setPatienceTimeGen

public void setPatienceTimeGen(RandomVariateGen pgen)
Sets the random variate generator for patience times to pgen.

Parameters:
pgen - the new random variate generator for patience times.

getContactTimeGen

public RandomVariateGen getContactTimeGen()
Returns the random-variate generator for default contact times. This generates the contact times used when no contact time specific to the agent group performing the service is available.

Returns:
the random variate generator for contact times.

setContactTimeGen

public void setContactTimeGen(RandomVariateGen cgen)
Sets the random variate generator for default contact times to cgen.

Parameters:
cgen - the new random variate generator for contact times.

getAfterContactTimeGen

public RandomVariateGen getAfterContactTimeGen()
Returns the random-variate generator for default after-contact times. This generates the after-contact times used when no after-contact time specific to the agent group performing the service is available.

Returns:
the random variate generator for default after-contact times.

setAfterContactTimeGen

public void setAfterContactTimeGen(RandomVariateGen acgen)
Sets the random variate generator for default after-contact times to acgen.

Parameters:
acgen - the new random variate generator for default after-contact times.

getContactTimeGenGroups

public RandomVariateGen[] getContactTimeGenGroups()
Returns the random variate generators for contact times when served by agents in specific groups.

Returns:
the contact time generators.

getContactTimeGen

public RandomVariateGen getContactTimeGen(int i)
Returns the random variate generator for contacts served by agents in group i.

Parameters:
i - the agent group index.
Returns:
the contact time generator.

setContactTimeGenGroups

public void setContactTimeGenGroups(RandomVariateGen[] cgenGroups)
Sets the contact-time generators for contacts served by specific agent groups to cgenGroups.

Parameters:
cgenGroups - the new contact-time generators.

getAfterContactTimeGenGroups

public RandomVariateGen[] getAfterContactTimeGenGroups()
Returns the random variate generators for after-contact times when served by agents in specific groups.

Returns:
the after-contact time generators.

getAfterContactTimeGen

public RandomVariateGen getAfterContactTimeGen(int i)
Returns the random variate generator for contacts served by agents in group i.

Parameters:
i - the agent group index.
Returns:
the after-contact time generator.

setAfterContactTimeGenGroups

public void setAfterContactTimeGenGroups(RandomVariateGen[] acgenGroups)
Sets the contact-time generators for contacts served by specific agent groups to cgenGroups.

Parameters:
acgenGroups - the new contact-time generators.

getMeanContactTime

public double getMeanContactTime(int i)
Returns the mean contact time for a new contact served by an agent in group i.

Parameters:
i - the agent group identifier.
Returns:
the mean contact time.

getMeanAfterContactTime

public double getMeanAfterContactTime(int i)
Returns the mean after-contact time for a new contact served by an agent in group i.

Parameters:
i - the agent group identifier.
Returns:
the mean contact time.

getTypeId

public int getTypeId()
Returns the type identifier for contacts returned by this factory.

Returns:
the type identifier of constructed contacts.

setTypeId

public void setTypeId(int type)
Sets the type identifier of constructed contacts to type.

Parameters:
type - the type identifier of constructed contacts.

ContactCenters
V. 0.9.9.

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