|
|
@ -34,6 +34,11 @@ import prism.PrismLog; |
|
|
*/ |
|
|
*/ |
|
|
public abstract class MDStrategy implements Strategy |
|
|
public abstract class MDStrategy implements Strategy |
|
|
{ |
|
|
{ |
|
|
|
|
|
/** |
|
|
|
|
|
* Current state of model |
|
|
|
|
|
*/ |
|
|
|
|
|
protected int currentState = -1; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Get the number of states of the model associated with this strategy. |
|
|
* Get the number of states of the model associated with this strategy. |
|
|
*/ |
|
|
*/ |
|
|
@ -56,6 +61,26 @@ public abstract class MDStrategy implements Strategy |
|
|
*/ |
|
|
*/ |
|
|
public abstract Object getChoiceAction(int s); |
|
|
public abstract Object getChoiceAction(int s); |
|
|
|
|
|
|
|
|
|
|
|
// Methods for Strategy |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public void initialise(int s) |
|
|
|
|
|
{ |
|
|
|
|
|
currentState = s; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public void update(int action, int s) |
|
|
|
|
|
{ |
|
|
|
|
|
currentState = s; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public Object getChoiceAction() |
|
|
|
|
|
{ |
|
|
|
|
|
return getChoiceAction(currentState); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void exportActions(PrismLog out) |
|
|
public void exportActions(PrismLog out) |
|
|
{ |
|
|
{ |
|
|
|