|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsamples.random.RandomListGenerator
samples.random.ProportionRandomListGenerator
public abstract class ProportionRandomListGenerator
This class allows generating integer random lists using a proportion model. A given fixed number of tuples is randomly generated.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class samples.random.RandomListGenerator |
---|
RandomListGenerator.Structure |
Field Summary | |
---|---|
protected int |
nbAllowedOverflows
The number of allowed overflows wrt the maximum number of occurences of each value. |
protected int |
nbCurrentOverflows
The current number of overflows wrt the maximum number of occurences of each value. |
protected int |
nbMaxOccurences
The maximum number of occurences of each value. |
protected int |
nbWishedOccurences
The wished number of occurences of each value. |
protected static int |
OCCURENCES_LIMIT
|
Fields inherited from class samples.random.RandomListGenerator |
---|
fixedTuple, LOGGER, nbMaxValues, nbOccurences, nbValues, random, requiredFixedTuple, seed, tupleLength, tupleRepetition, tuples, type, valueRepetition |
Constructor Summary | |
---|---|
ProportionRandomListGenerator(int[] nbValues,
long seed)
Builds a proportion random list generator. |
|
ProportionRandomListGenerator(int nb,
int tupleLength,
long seed)
Builds a proportion random list generator. |
Method Summary | |
---|---|
void |
displayTuples()
Displays the current random generated list. |
protected void |
fixLimits(RandomListGenerator.Structure type)
Fixes some limits, according to the given type, about the generation of tuples. |
protected abstract void |
makeSelection()
Makes the selection of the given number of tuples. |
protected boolean |
mustTupleWait(int[] tuple)
Determines if the given tuple can be currently selected. |
protected boolean |
mustValueWait(int value)
Determines (according to some selection constraints) if the given value can be currently selected. |
protected void |
restoreNbOccurrences()
Restores the current number of occurences of each value and the current number of overflows. |
int[][] |
selectTuples(int nbTuples,
RandomListGenerator.Structure type,
boolean tupleRepetition,
boolean valueRepetition)
Generates and returns a random list. |
int[][] |
selectTuples(int nbTuples,
RandomListGenerator.Structure type,
boolean tupleRepetition,
boolean valueRepetition,
int[] fixedTuple,
boolean requiredFixedTuple)
Generates and returns a random list. |
protected void |
storeNbOccurrences()
Saves the current number of occurences of each value and the current number of overflows. |
Methods inherited from class samples.random.RandomListGenerator |
---|
cnp, computeNbArrangementsFrom, computeNbCombinationsFrom, computeNbCombinationsFrom, computeNbDistinctTuples, getSelectionDescription, getTuples, saveElements, setParameters, updateNbValueOccurencesFor |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int OCCURENCES_LIMIT
protected int nbWishedOccurences
protected int nbMaxOccurences
protected int nbAllowedOverflows
protected int nbCurrentOverflows
Constructor Detail |
---|
public ProportionRandomListGenerator(int[] nbValues, long seed)
nbValues
- the number of values for each element of the tuplesseed
- the seed used to generate random numberspublic ProportionRandomListGenerator(int nb, int tupleLength, long seed)
nb
- the uniform number of values used to build tuplestupleLength
- the length of each tupleseed
- the seed used to generate random numbersMethod Detail |
---|
protected void storeNbOccurrences()
protected void restoreNbOccurrences()
protected void fixLimits(RandomListGenerator.Structure type)
type
- the type of the generated lists which can be UNSTRUCTURED, CONNECTED or BALANCEDprotected boolean mustValueWait(int value)
value
- a given value
false
iff the given value can be currently put in a tuple.protected boolean mustTupleWait(int[] tuple)
tuple
- the given tuple
false
iff the given value can be currently put in a tupleprotected abstract void makeSelection()
public int[][] selectTuples(int nbTuples, RandomListGenerator.Structure type, boolean tupleRepetition, boolean valueRepetition, int[] fixedTuple, boolean requiredFixedTuple)
nbTuples
- the number of tuples to be selectedtype
- the type of the generated lists which can be UNSTRUCTURED, CONNECTED or BALANCEDtupleRepetition
- indicates if the same tuple can occur several times in the generated listsvalueRepetition
- indicates if the same value can occur several times in a generated tuplefixedTuple
- a particular tuple, which if not null
, must or must not belong to the generated listsrequiredFixedTuple
- indicates if the fixed tuple, if not null
, must or must not belong to the generated lists
public int[][] selectTuples(int nbTuples, RandomListGenerator.Structure type, boolean tupleRepetition, boolean valueRepetition)
nbTuples
- the number of tuples to be selectedtype
- the type of the generated lists which can be UNSTRUCTURED, CONNECTED or BALANCEDtupleRepetition
- indicates if the same tuple can occur several times in the generated listsvalueRepetition
- indicates if the same value can occur several times in a generated tuple
public void displayTuples()
RandomListGenerator
displayTuples
in class RandomListGenerator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |