public interface ObjectState
Title: Object State
Description: A stateful, single thread object, that can act upon itself
Modifier and Type | Method and Description |
---|---|
double |
doAction(double currentScore,
double desparationValue)
Perform an action
|
java.lang.Object |
getStateReference() |
boolean |
isMaximiseScore()
If true, than a bigger score is better, otherwise a smaller score is better
|
void |
restoreState(java.lang.Object stateReference)
Used to restore the state of the this object to that of a previous time point
|
boolean |
undoAction()
Undo the last action (if it was successful)
Users of an ObjectState should accept that sometimes undoing an action isn't possible.
|
double doAction(double currentScore, double desparationValue)
currentScore
- The current score before doing the actiondesparationValue
- An indication by the processing machines of willingness to do more extreme actions. A value of 0 means not desparate at all, a value of 1 means very desparateboolean undoAction()
java.lang.Object getStateReference()
void restoreState(java.lang.Object stateReference)
stateReference
- An object returned by getStateReference()boolean isMaximiseScore()