public class SmartChanceGenerator
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SmartChanceGenerator.ModificationType
Enumeration for possible Modifications.
|
| Constructor and Description |
|---|
SmartChanceGenerator(long seed)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
doModification(SmartChanceGenerator.ModificationType mod)
Delegates the modification type to the right function and logs the
modification in the history.
|
PetriNet |
generateNet(int value,
int initMarkingValue)
Method that gets called by Check.
|
void |
renewNet(int initMarkingValue)
Generates a new net and clears the modification histroy.
|
protected void |
reset()
Resets the history.
|
protected void |
resetChances()
Resets the chances hashmap and gets all chances back to 1.0.
|
protected boolean |
undoModification()
Undoes a modification.
|
protected boolean |
validateScore(int value)
Called to react on score information.
|
public SmartChanceGenerator(long seed)
seed - the random seed. Pass 0 for no preset seed.public void renewNet(int initMarkingValue)
initMarkingValue - the initial marking of the net.protected void reset()
protected void resetChances()
public PetriNet generateNet(int value, int initMarkingValue)
value - the scoreinitMarkingValue - the initial marking value of the netprotected boolean validateScore(int value)
value - valueprotected boolean doModification(SmartChanceGenerator.ModificationType mod)
mod - the modification.protected boolean undoModification()