|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectumontreal.iro.lecuyer.contactcenters.contact.ServiceTimes
umontreal.iro.lecuyer.contactcenters.contact.ServiceTimesAgent
public class ServiceTimesAgent
Stores service times for a contact. For each of these types, one may generate a default service time v which applies for all agents, or one service time vaj for each agent j. This class is used to store and retrieve service times, when they are different for each agent. Otherwise, one should use the mother class ServiceTimes, where service times are defined only for groups of agents. For greater efficiency, it is recommended to call methods ensureCapacityForServiceTime before using setServiceTime in order to avoid multiple array reallocations.
Field Summary |
---|
Fields inherited from class umontreal.iro.lecuyer.contactcenters.contact.ServiceTimes |
---|
servTime |
Constructor Summary | |
---|---|
ServiceTimesAgent(double serviceTime)
Constructs a new container for service times using the default service time serviceTime if no service time was given for a specific agent or group. |
Method Summary | |
---|---|
void |
add(ServiceTimes st)
Adds the service times stored in st to the corresponding service times in this object. |
ServiceTimesAgent |
clone()
Clones this object, and its internal arrays of service times. |
void |
ensureCapacityForServiceTime(int capacity)
Makes sure that the length of the array containing the vaj's is at least capacity for the number of agents. |
double |
getServiceTime(int j)
Returns the service time vaj for contacts served by agent j. |
double[] |
getServiceTimes()
Returns the array of service times for all agents. |
boolean |
isSetServiceTime(int j)
Determines if a service time was set specifically for agent j by using setServiceTime(int,double) . |
void |
mult(double mult)
Multiplies each service time v and vaj stored in this object by the given constant mult. |
void |
set(ServiceTimes st)
Replaces the service times v, vi's and vaj's stored in this object with the values obtained from st. |
void |
setServiceTime(int j,
double t)
Sets the service time vaj for contacts served by an agent j to t. |
String |
toString()
|
Methods inherited from class umontreal.iro.lecuyer.contactcenters.contact.ServiceTimes |
---|
getServiceTime, setServiceTime |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ServiceTimesAgent(double serviceTime)
serviceTime
- the default service time v.
IllegalArgumentException
- if the given service
time is negative or NaN.Method Detail |
---|
public double getServiceTime(int j)
isSetServiceTime(int)
returns false,
this returns the result of ServiceTimes.getServiceTime()
.
getServiceTime
in class ServiceTimes
j
- the index of the agent.
public double[] getServiceTimes()
getServiceTimes
in class ServiceTimes
public boolean isSetServiceTime(int j)
setServiceTime(int,double)
.
isSetServiceTime
in class ServiceTimes
j
- the tested agent index.
public void setServiceTime(int j, double t)
Double.NaN
unsets the service time for the specified agent.
setServiceTime
in class ServiceTimes
j
- index of the agent to set.t
- new service time.
IllegalArgumentException
- if t is negative.public void ensureCapacityForServiceTime(int capacity)
setServiceTime(int,double)
to avoid multiple array reallocations.
ensureCapacityForServiceTime
in class ServiceTimes
capacity
- the new capacity for the agents.public void set(ServiceTimes st)
set
in class ServiceTimes
st
- the input service times.public void add(ServiceTimes st)
add
in class ServiceTimes
st
- the service times to add to this object.public void mult(double mult)
mult
in class ServiceTimes
mult
- the multiplier for service times.
IllegalArgumentException
- if mult is negative.public ServiceTimesAgent clone()
clone
in class ServiceTimes
public String toString()
toString
in class ServiceTimes
|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |