public abstract class Environment
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
Environment.CurStateTerminalTF
A terminal function that always returns whether the current environment state
is a terminal state, regardless of the state parameter passed to the method.
|
class |
Environment.LastRewardRF
A reward function that returns the last reward returned by the environment, regardless
of the state, action, state parameters passed to the method.
|
Constructor and Description |
---|
Environment() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
curStateIsTerminal()
Returns whether the current environment state is a terminal state.
|
State |
executeAction(GroundedAction ga)
This method is used to pass a
GroundedAction to be executed in this environment. |
abstract State |
executeAction(java.lang.String aname,
java.lang.String[] params)
Tells the environment to execute the action with the given name and with the given parameters.
|
State |
getCurState()
Returns the current state of the environment
|
RewardFunction |
getEnvironmentRewardRFWrapper()
Returns a reward function whose reward value is always whatever the last reward value of the environment is,
regardless of which state, action, state parameters are passed to it.
|
TerminalFunction |
getEnvironmentTerminalStateTFWrapper()
Returns a terminal function that returns true when the current state of the environment is terminal, regardless
of the state parameter passed to the method.
|
abstract double |
getLastReward()
Returns the last reward returned by the environment
|
void |
setCurStateTo(State s)
Sets the current state of the environment
|
protected State curState
public void setCurStateTo(State s)
s
- which state to set the environment topublic State getCurState()
public RewardFunction getEnvironmentRewardRFWrapper()
public TerminalFunction getEnvironmentTerminalStateTFWrapper()
public final State executeAction(GroundedAction ga)
GroundedAction
to be executed in this environment. This method
simply unpacks the action name and paraemters from the GroundedAction
and sends it to the executeAction(String, String[])
method. Unpacking is performed to ensure that there is no mix up between the action objects that refer to this
Environment and underlying Actions that this environment executes.ga
- the GroundedAction that is to be performed in this environment.public abstract State executeAction(java.lang.String aname, java.lang.String[] params)
aname
- the name of the action to executeparams
- the parameters of the actionpublic abstract double getLastReward()
public abstract boolean curStateIsTerminal()