|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpal.algorithmics.GeneralObjectState
public class GeneralObjectState
Title:
Description:
Copyright: Copyright (c) 2003
Company:
| Constructor Summary | |
|---|---|
GeneralObjectState(UndoableAction action,
StateProvider subject,
boolean maximise)
|
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GeneralObjectState(UndoableAction action,
StateProvider subject,
boolean maximise)
| Method Detail |
|---|
public double doAction(double currentScore,
double desparationValue)
doAction in interface ObjectStatecurrentScore - the current score before doing the actiondesparationValue - An indication of how desparate we are, values closer to 1 mean more desparate while values towards 0 mean less desparate
public boolean undoAction()
ObjectState
undoAction in interface ObjectStatepublic java.lang.Object getStateReference()
getStateReference in interface ObjectStatepublic void restoreState(java.lang.Object stateReference)
ObjectState
restoreState in interface ObjectStatestateReference - An object returned by getStateReference()public boolean isMaximiseScore()
ObjectState
isMaximiseScore in interface ObjectState
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||