|
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.MinValueGenerator
public class MinValueGenerator
Value generator for the minimum of values. This value generator defines an
internal array of value generators used by the nextDouble(umontreal.iro.lecuyer.contactcenters.contact.Contact)
method.
When nextDouble(umontreal.iro.lecuyer.contactcenters.contact.Contact)
is called, a value is generated using all registered
value generators and the minimum value, generated by v[j*], is returned.
It is also possible to get the index j* of the value generator having
returned the minimum as well as all the generated values. This class is used
by waiting queues and agent groups to generate the maximal queue times and
service times.
Constructor Summary | |
---|---|
MinValueGenerator()
Constructs a minimum value generator with no registered internal value generator. |
|
MinValueGenerator(int initialLength)
Constructs a minimum value generator with an internal array of value generators containing initialLength elements. |
Method Summary | |
---|---|
void |
compact()
Recreates the internal array of value generators for its length to correspond to getMaxVType() . |
double |
getLastValue()
Returns the last value returned by nextDouble(umontreal.iro.lecuyer.contactcenters.contact.Contact) . |
double |
getLastValue(int vType)
Returns the value generated by getValueGenerator (vType) upon the
last call to nextDouble(umontreal.iro.lecuyer.contactcenters.contact.Contact) if isKeepingValues() returns
true, or throws an IllegalStateException . |
double[] |
getLastValues()
Returns all the generated values upon the last call to nextDouble(umontreal.iro.lecuyer.contactcenters.contact.Contact)
if isKeepingValues() returns true, or throws an
IllegalStateException . |
int |
getLastVType()
Returns the value type for the last value. |
int |
getMaxVType()
Returns the maximum index (non-inclusive) for which getValueGenerator(int) returns a non-null value. |
ValueGenerator |
getValueGenerator(int vType)
Returns the value generator corresponding to value type vType. |
void |
init()
Initializes all the associated value generators. |
boolean |
isKeepingValues()
Determines if the value generator is keeping all the generated values used to compute the last minimum. |
double |
nextDouble(Contact contact)
Generates and returns a new value for the contact contact. |
void |
setKeepingValues(boolean k)
Sets the keeping-values indicator to k. |
void |
setValueGenerator(int vType,
ValueGenerator vgen)
Sets the value generator corresponding to value type vType to vgen. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MinValueGenerator()
public MinValueGenerator(int initialLength)
initialLength
- the number of elements in the internal array.Method Detail |
---|
public void compact()
getMaxVType()
.
public int getMaxVType()
getValueGenerator(int)
returns a non-null value.
public ValueGenerator getValueGenerator(int vType)
vType
- the queried value type.
public void setValueGenerator(int vType, ValueGenerator vgen)
Since the value generators are stored in an internal array, it is recommended to use small value types. This will avoid the creation of large arrays of null's.
vType
- the affected value type.vgen
- the new value generator.public boolean isKeepingValues()
public void setKeepingValues(boolean k)
k
- the new keeping-values indicator.public void init()
init
in interface Initializable
init
in interface ValueGenerator
public double nextDouble(Contact contact)
nextDouble
in interface ValueGenerator
contact
- the contact for which a value is generated.
public double getLastValue()
nextDouble(umontreal.iro.lecuyer.contactcenters.contact.Contact)
.
public int getLastVType()
getValueGenerator(int)
, having
generated the chosen minimal value.
public double[] getLastValues()
nextDouble(umontreal.iro.lecuyer.contactcenters.contact.Contact)
if isKeepingValues()
returns true, or throws an
IllegalStateException
. The length of the returned array
corresponds to getMaxVType()
.
IllegalStateException
- if the object does not keep generated values.public double getLastValue(int vType)
getValueGenerator
(vType) upon the
last call to nextDouble(umontreal.iro.lecuyer.contactcenters.contact.Contact)
if isKeepingValues()
returns
true, or throws an IllegalStateException
. If the
associated value generator is null, Double.NaN is
returned.
vType
- the queried value type.
IllegalStateException
- if the object does not keep generated values.
ArrayIndexOutOfBoundsException
- if vType is negative or greater than or equal to
getMaxVType()
.
|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |