|
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.xmlbind.NamedInfo
umontreal.iro.lecuyer.contactcenters.msk.model.SegmentInfo
public class SegmentInfo
Represents information about a user-defined segment regrouping some indexed entities such as call types, agent groups, or periods. Each segment has a name, optional user-defined properties, and a list of indices.
Segment information is extracted from a SegmentParams
instance which
is read from a XML file by JAXB. The method getValues()
can be used
to obtain the indices regrouped by the segment, while
containsValue(int)
tests if a specific index is contained in the
segment.
Constructor Summary | |
---|---|
SegmentInfo(SegmentParams par)
Constructs a new segment information object from the segment parameters par. |
Method Summary | |
---|---|
static DoubleMatrix2D |
addColumnSegments(DoubleMatrix2D mat,
DoubleDoubleFunction func,
SegmentInfo... segments)
Similar to DoubleDoubleFunction,SegmentInfo...) ,
for adding extra columns to matrix mat. |
static DoubleMatrix2D |
addRowSegments(DoubleMatrix2D mat,
DoubleDoubleFunction func,
boolean[] globalSegmentValues,
SegmentInfo... segments)
Constructs and returns a matrix with all the rows in mat, extra rows corresponding to the segments in segments, and an additional row representing the aggregation of all rows in the original matrix. |
static DoubleMatrix2D |
addRowSegments(DoubleMatrix2D mat,
DoubleDoubleFunction func,
SegmentInfo... segments)
Calls addRowSegments (mat, func, null, segments). |
static DoubleMatrix2D |
addRowSegments(DoubleMatrix2D mat,
int numGroups,
DoubleDoubleFunction func,
boolean[] globalSegmentValues1,
boolean[] globalSegmentValues2,
SegmentInfo[] segments1,
SegmentInfo[] segments2)
Constructs and returns a matrix with all the rows in mat, and extra rows corresponding to the segments in segments1 and segments2. |
static void |
checkRange(int lower,
int upper,
SegmentInfo... segments)
Checks that the minimal value stored in all the segments segments is greater than or equal to lower, and the maximal value is smaller than upper. |
boolean |
containsValue(int i)
Tests if the index i is included in the list of values associated with this segment. |
int |
getMaxValue()
Returns the maximal index in this segment. |
int |
getMinValue()
Returns the minimal index in this segment. |
int |
getNumValues()
Returns the number of different values in this segment. |
static SegmentInfo[] |
getSegments(Collection<? extends SegmentParams> par)
Converts the given collection of segment parameters into an array of segment information objects. |
int[] |
getValues()
Returns the reference to an array containing the list of values in this segment. |
Methods inherited from class umontreal.iro.lecuyer.xmlbind.NamedInfo |
---|
getName, getProperties, getStringProperties |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SegmentInfo(SegmentParams par)
par
- the segment parameters.
IllegalArgumentException
- if some segment parameters wre invalid.Method Detail |
---|
public int[] getValues()
public int getNumValues()
public int getMinValue()
public int getMaxValue()
public boolean containsValue(int i)
getValues()
.
i
- the tested index.
public static SegmentInfo[] getSegments(Collection<? extends SegmentParams> par)
par
- collection of segment parameters.
IllegalArgumentException
- if an error occurs during the creation of a segment
information object.public static void checkRange(int lower, int upper, SegmentInfo... segments)
lower
- the lower bound (inclusive).upper
- the upper bount (non-inclusive).segments
- the array of segments to test.
IllegalArgumentException
- if at least one segment contains an out-of-bounds value.public static DoubleMatrix2D addRowSegments(DoubleMatrix2D mat, DoubleDoubleFunction func, SegmentInfo... segments)
addRowSegments
(mat, func, null, segments).
mat
- the matrix to process.func
- the function f.segments
- the segments for which rows are added in the matrix.
public static DoubleMatrix2D addRowSegments(DoubleMatrix2D mat, DoubleDoubleFunction func, boolean[] globalSegmentValues, SegmentInfo... segments)
containsValue(int)
method of segments[r] while ss, i
is 1 if and only if globalSegmentValues[i] is true. If
globalSegmentValues is null, ss, i is set to 1 for
all i in the last row.
Usually, func which represents f is set to
Functions.plus
, or Functions.max
. In the former case,
f (x, y) = x + y, and Mi, j is
mat
- the matrix to process.func
- the function f.globalSegmentValues
- determines which rows are summed up in the global segment.segments
- the segments for which rows are added in the matrix.
public static DoubleMatrix2D addRowSegments(DoubleMatrix2D mat, int numGroups, DoubleDoubleFunction func, boolean[] globalSegmentValues1, boolean[] globalSegmentValues2, SegmentInfo[] segments1, SegmentInfo[] segments2)
addRowSegments(DoubleMatrix2D,DoubleDoubleFunction,boolean[],SegmentInfo...)
.
mat
- the matrix to process.numGroups
- the value of c, a being determined using mat.func
- the function f.globalSegmentValues1
- determines which rows are summed up in the global segment for
the first dimension.globalSegmentValues2
- determines which rows are summed up in the global segment for
the second dimension.segments1
- the segments for which rows are added in the matrix, for the
first dimension.segments2
- the segments for which rows are added in the matrix, for the
second dimension.
public static DoubleMatrix2D addColumnSegments(DoubleMatrix2D mat, DoubleDoubleFunction func, SegmentInfo... segments)
DoubleDoubleFunction,SegmentInfo...)
,
for adding extra columns to matrix mat.
mat
- the matrix to process.func
- the function f.segments
- the segments for which rows are added in the matrix.
|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |