|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object infoservice.dynamic.ADynamicCascadeBuildingStrategy infoservice.dynamic.ComleteRandomStrategy
public class ComleteRandomStrategy
This is an implementation of a IDynamicCascadeBuildingStrategy
.
It creates new cascades purly at random using the seed previously agreed upon
by all other InfoServices.
Constructor Summary | |
---|---|
ComleteRandomStrategy()
|
Method Summary | |
---|---|
java.util.Vector |
circuit(java.util.Vector firstAndMiddleMixes,
java.util.Vector lastMixes,
long seedForRandomGenerator)
Creates the mix cascades. |
java.util.Vector |
createCascades(java.util.Vector firstMixes,
java.util.Vector middleMixes,
java.util.Vector lastMixes,
long seed)
Creates new mix cascades out of the given first, middle and last mixes. |
private java.util.Vector |
randomizeIt(java.util.Vector a_vector,
int[] a_randArr)
Randomizes the given Vector |
private java.util.Vector |
randomizeVector(java.util.Vector a_vector,
java.util.Random a_random)
Randomizes the given Vector using the given
Random . |
Methods inherited from class infoservice.dynamic.ADynamicCascadeBuildingStrategy |
---|
buildCascade |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ComleteRandomStrategy()
Method Detail |
---|
public java.util.Vector createCascades(java.util.Vector firstMixes, java.util.Vector middleMixes, java.util.Vector lastMixes, long seed) throws java.lang.Exception
IDynamicCascadeBuildingStrategy
Vector
of MixCascade
s. The
given seed must be used as the seed for a PRNG, as all InfoServices must
come to the same resulting cascades.
createCascades
in interface IDynamicCascadeBuildingStrategy
createCascades
in class ADynamicCascadeBuildingStrategy
firstMixes
- The MixInfo
s of the first mixes to be usedmiddleMixes
- The MixInfo
s of the middle mixes to be usedlastMixes
- The MixInfo
s of the last mixes to be usedseed
- The seed for the PRNG
Vector
if MixCascade
containing
the new cascades
java.lang.Exception
public java.util.Vector circuit(java.util.Vector firstAndMiddleMixes, java.util.Vector lastMixes, long seedForRandomGenerator) throws java.lang.Exception
firstAndMiddleMixes
- Set of available first and middle mixes.lastMixes
- Set of available last-mixes.seedForRandomGenerator
-
java.lang.Exception
private java.util.Vector randomizeIt(java.util.Vector a_vector, int[] a_randArr)
Vector
a_vector
- a_randArr
-
private java.util.Vector randomizeVector(java.util.Vector a_vector, java.util.Random a_random)
Vector
using the given
Random
.
a_vector
- The Vector
to be randomizeda_random
- The Random
to use
Vector
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |