|
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.msk.conditions.ConditionUtil
public class ConditionUtil
Provides helper methods to construct condition objects
using ConditionParams
instances usually parsed
from XML configuration files.
The main method of this class is
createCondition(CallCenter,int,ConditionParams)
which uses other methods to make a Condition
object out of the information provided by the parameters.
Method Summary | ||
---|---|---|
static boolean |
applies(double v1,
double v2,
Relationship rel)
Returns true if and only if a condition comparing v1 and v2 based on relationship rel applies. |
|
static AndCondition |
createAndCondition(CallCenter cc,
int k,
ConditionParamsList par)
Similar to createOrCondition(CallCenter,int,ConditionParamsList) , for
an ``and'' condition. |
|
static Condition |
createCondition(CallCenter cc,
int k,
ConditionParams par)
Constructs a condition object for call center cc, and using parameters par. |
|
static Condition |
createCondition(CallCenter cc,
int k,
JAXBElement<?> el)
Similar to createCondition(CallCenter,int,ConditionParams) , but
from a JAXBElement instance. |
|
static
|
createCustom(Class<T> base,
CallCenter cc,
int k,
Named par)
Creates an object of base class base, from the parameter object par, and using the call center model cc. |
|
static Condition |
createCustomCondition(CallCenter cc,
int k,
Named par)
Calls createCustom
(Condition.class, cc, k, par). |
|
static FracBusyAgentsCondition |
createFracBusyAgentsCondition(CallCenter cc,
TwoIndicesWithTypesParams par)
Creates a new condition on the fraction of busy agents using the call center model cc, and the parameters in par. |
|
static FracBusyAgentsThreshCondition |
createFracBusyAgentsThreshCondition(CallCenter cc,
IndexThreshWithTypeParams par)
Creates a new condition on the fraction of busy agents using the call center model cc, and the parameters in par. |
|
static NumFreeAgentsCondition |
createNumFreeAgentsCondition(CallCenter cc,
TwoIndicesParams par)
Similar to createQueueSizeCondition(CallCenter,TwoIndicesWithTypesParams) , for
a condition on the number of free agents. |
|
static NumFreeAgentsThreshCondition |
createNumFreeAgentsThreshCondition(CallCenter cc,
IndexThreshIntParams par)
Similar to createQueueSizeThreshCondition(CallCenter,IndexThreshIntWithTypeParams) , for
a condition on the number of free agents. |
|
static OrCondition |
createOrCondition(CallCenter cc,
int k,
ConditionParamsList par)
Creates an ``or'' condition from the call center model cc, and the parameters par. |
|
static QueueSizesCondition |
createQueueSizeCondition(CallCenter cc,
TwoIndicesWithTypesParams par)
Creates a condition on the queue size from parameters par, and call center model cc. |
|
static QueueSizeThreshCondition |
createQueueSizeThreshCondition(CallCenter cc,
IndexThreshIntWithTypeParams par)
Creates a condition on the queue size from parameters par, and call center model cc. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Condition createCondition(CallCenter cc, int k, ConditionParams par)
createOrCondition(CallCenter,int,ConditionParamsList)
or
createAndCondition(CallCenter,int,ConditionParamsList)
,
respectively, and returns the result.
If the queueSizes element is set, the
method returns the result of
createQueueSizeCondition(CallCenter,TwoIndicesWithTypesParams)
.
If the queueSizeThresh element is set,
the method returns the result of
createQueueSizeThreshCondition(CallCenter,IndexThreshIntWithTypeParams)
.
If numFreeAgents is set, the method
returns the result of createNumFreeAgentsCondition(CallCenter,TwoIndicesParams)
.
If numFreeAgentsThresh is set, the method
returns the result of createNumFreeAgentsThreshCondition(CallCenter,IndexThreshIntParams)
.
If fracBusyAgents is set, the method
returns the result of createFracBusyAgentsCondition(CallCenter,TwoIndicesWithTypesParams)
.
If fracBusyAgentsThresh is set, the method
returns the result of createFracBusyAgentsThreshCondition(CallCenter,IndexThreshWithTypeParams)
.
The result of createCustomCondition(CallCenter,int,Named)
is
returned if custom is set.
cc
- the call center model.k
- the index of the call type for which the condition concerns.par
- the parameters from which conditions are created.
IllegalArgumentException
- if a problem occurs
during the creation of the condition.public static Condition createCondition(CallCenter cc, int k, JAXBElement<?> el)
createCondition(CallCenter,int,ConditionParams)
, but
from a JAXBElement
instance.
The type of the condition created depends on the name of the element,
obtained using JAXBElement.getName()
.
The value of the element, obtained using
JAXBElement.getValue()
, is cast to the
appropriate class, and needed creation method is called.
cc
- the call center model.k
- the index of the call type for which the condition concerns.el
- the JAXB element corresponding to the condition.
IllegalArgumentException
- if a problem occurs
during the creation of the condition.public static OrCondition createOrCondition(CallCenter cc, int k, ConditionParamsList par)
JAXBElement
representing parameters for
a condition.
The method uses createCondition(CallCenter,int,JAXBElement)
to convert this element into a Condition
object,
and gathers the created objects into an array used
to create the returned instance of
OrCondition
.
cc
- the call center model.k
- the index of the call type for which the condition concerns.par
- the parameters for the condition.
IllegalArgumentException
- if a problem occurs
during the creation of one of the associated conditions.public static AndCondition createAndCondition(CallCenter cc, int k, ConditionParamsList par)
createOrCondition(CallCenter,int,ConditionParamsList)
, for
an ``and'' condition.
public static QueueSizesCondition createQueueSizeCondition(CallCenter cc, TwoIndicesWithTypesParams par)
cc
- the call center model.par
- the condition parameters.
public static QueueSizeThreshCondition createQueueSizeThreshCondition(CallCenter cc, IndexThreshIntWithTypeParams par)
cc
- the call center model.par
- the condition parameters.
public static NumFreeAgentsCondition createNumFreeAgentsCondition(CallCenter cc, TwoIndicesParams par)
createQueueSizeCondition(CallCenter,TwoIndicesWithTypesParams)
, for
a condition on the number of free agents.
public static NumFreeAgentsThreshCondition createNumFreeAgentsThreshCondition(CallCenter cc, IndexThreshIntParams par)
createQueueSizeThreshCondition(CallCenter,IndexThreshIntWithTypeParams)
, for
a condition on the number of free agents.
public static FracBusyAgentsCondition createFracBusyAgentsCondition(CallCenter cc, TwoIndicesWithTypesParams par)
cc
- the call center model.par
- the condition parameters.
public static FracBusyAgentsThreshCondition createFracBusyAgentsThreshCondition(CallCenter cc, IndexThreshWithTypeParams par)
cc
- the call center model.par
- the condition parameters.
public static Condition createCustomCondition(CallCenter cc, int k, Named par)
createCustom
(Condition.class, cc, k, par).
cc
- the call center model.k
- the index of the call type concerning the condition.par
- the parameters for the custom condition.
public static <T> T createCustom(Class<T> base, CallCenter cc, int k, Named par)
Class.forName(String)
.
It then checks that the corresponding class is a subclass
of or implements base.
If this is true, it searches for a constructor, and
calls it to create an instance.
The method looks for the following signatures, and
the given order of priority:
(CallCenter
, int, Map
),
(CallCenter
, int),
(CallCenter
, Map
),
(int, Map
),
(CallCenter
),
(int),
(Map
), and ().
The last signature corresponds to the no-argument constructor.
The instance of CallCenter
is cc while
the map is created by using
ParamReadHelper.unmarshalProperties(PropertiesParams)
on
the properties associated with par.
base
- the base class to be used.cc
- the call center model.k
- the index of the call type concerning the condition.par
- the parameters for the custom condition.
public static boolean applies(double v1, double v2, Relationship rel)
|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |