|
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.ctmc.EventWithTest
public abstract class EventWithTest
Abstract event type with some helper methods to generate u1≤u < u2 randomly and uniformly, and to test that u < t for any value of t.
Constructor Summary | |
---|---|
EventWithTest(double minU,
double maxU,
int numBits)
Constructs a new event with the associated interval [u1, u2), and using numBits additional random bits to generate u when needed. |
Method Summary | |
---|---|
double |
getMaxU()
Returns the value of u2 associated with this event. |
double |
getMinU()
Returns the value of u1 associated with this event. |
int |
getPosition(int rv,
int usedBits,
double weight,
double maxWeight,
int maxS)
Returns the value s for which 0≤u - sW < w, where s = 0,…, S - 1, or S if such s does not exist. |
double |
getU(int rv,
int usedBits)
Generates the value of u using bits in rv but ignoring the first least significant usedBits bits. |
boolean |
isUSmallerThan(int rv,
int usedBits,
double t)
Returns true if and only if u < t, using getU
(rv, usedBits)
to generate u randomly. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface umontreal.iro.lecuyer.contactcenters.ctmc.CCEvent |
---|
actions |
Constructor Detail |
---|
public EventWithTest(double minU, double maxU, int numBits)
minU
- the value of u1.maxU
- the value of u2.numBits
- the number of bits
used to generate u.Method Detail |
---|
public double getMinU()
public double getMaxU()
public double getU(int rv, int usedBits)
rv
- the random bits to generate
u from.usedBits
- the number of used
random bits.
public boolean isUSmallerThan(int rv, int usedBits, double t)
getU
(rv, usedBits)
to generate u randomly.
This method returns true
without generating u if
u2 < t since in that case, u < u2 < t.
Similarly, it returns false
without generating u if
u1≥t since in this case,
u≥u1≥t.
Otherwise, getU(int,int)
is called to get the value of u.
rv
- the random bits to generate
u from.usedBits
- the number of used
random bits.t
- the tested threshold.
public int getPosition(int rv, int usedBits, double weight, double maxWeight, int maxS)
rv
- the random bits to generate
u from.usedBits
- the number of used
random bits.weight
- the value of w.maxWeight
- the value of W.maxS
- the maximal value S of s.
|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |