|
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.ConstantValueGenerator
public class ConstantValueGenerator
Implements the ValueGenerator
interface
for a constant and possibly non-stationary value.
During each period of the simulation, the generated value
is constant for each contact type. When a new period begins,
the constant value can be changed.
This implementation only takes contact type
identifiers (Contact.getTypeId()
) and
current period (PeriodChangeEvent.getCurrentPeriod()
)
into account for generating values.
Constructor Summary | |
---|---|
ConstantValueGenerator(double[] vals)
Constructs a new constant stationary value generator with value vals[k] for contact type k. |
|
ConstantValueGenerator(int numTypes,
double val)
Constructs a new constant stationary value generator supporting numTypes contact types, and with value val for each contact type. |
|
ConstantValueGenerator(PeriodChangeEvent pce,
double[][] vals)
Constructs a new constant value generator with values vals and period-change event pce. |
|
ConstantValueGenerator(PeriodChangeEvent pce,
int numTypes,
double[] vals)
Constructs a new constant value generator with period-change event pce, value vals[p] for period p, and supporting numTypes contact types. |
Method Summary | |
---|---|
double[][] |
getValues()
Returns the values used by this generator. |
void |
init()
Initializes the generator at the beginning of the simulation. |
double |
nextDouble(Contact contact)
Returns the value of the constant corresponding to the type of contact, and the current period. |
void |
setValues(double[][] vals)
Sets the values for this generator to vals. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ConstantValueGenerator(int numTypes, double val)
numTypes
- the number of supported contact types.val
- the value that will be returned by nextDouble(umontreal.iro.lecuyer.contactcenters.contact.Contact)
.public ConstantValueGenerator(double[] vals)
vals
- the values for each contact type.public ConstantValueGenerator(PeriodChangeEvent pce, int numTypes, double[] vals)
pce
- the associated period-change event.numTypes
- the number of supported contact types.vals
- the generated value for each period.
IllegalArgumentException
- if a value is not specified
for each period.public ConstantValueGenerator(PeriodChangeEvent pce, double[][] vals)
pce
- the associated period-change event.vals
- the array of values.
IllegalArgumentException
- if an array
of values is not specified for each period.Method Detail |
---|
public double[][] getValues()
ConstantValueGenerator(PeriodChangeEvent,double[][])
.
public void setValues(double[][] vals)
vals
- the new values for this generator.
IllegalArgumentException
- if the length
of the given array is incorrect.public double nextDouble(Contact contact)
nextDouble
in interface ValueGenerator
contact
- the contact being concerned.
public void init()
ValueGenerator
init
in interface Initializable
init
in interface ValueGenerator
public String toString()
toString
in class Object
|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |