public class LocalSubgoalRF extends java.lang.Object implements RewardFunction
StateConditionTest
objects. By default, a subgoal reward of 0 is returned for transitions to the subgoal states, the most negative value
for transitions to states in which the option is not applicable and -1 for any other transitions. All of these
values can be changed.Modifier and Type | Field and Description |
---|---|
protected StateConditionTest |
applicableStateTest
Defines the set of states in which the option is applicable
|
protected double |
defaultReward
Defines the reward returned for transitions to applicable states, but not subgoal states; default -1
|
protected double |
failReward
Defines the reward returned for transitions to states in which the option is not applicable; default -Double.MAX_VALUE
|
protected double |
subgoalReward
Defines the reward returned for transitions to subgoal states; default 0.
|
protected StateConditionTest |
subgoalStateTest
Defines he set of subgoal states for the option
|
Constructor and Description |
---|
LocalSubgoalRF(StateConditionTest subgoalStateTest)
Initializes with a given set of subgoal states.
|
LocalSubgoalRF(StateConditionTest subgoalStateTest,
double defaultReward,
double subgoalReward)
Initializes with a given set of subgoal states, a default reward and a subgoal reward.
|
LocalSubgoalRF(StateConditionTest applicableStateTest,
StateConditionTest subgoalStateTest)
Initializes with a set of states in which an option is applicable and which the agent should not enter and a set of
subgoal states
|
LocalSubgoalRF(StateConditionTest applicableStateTest,
StateConditionTest subgoalStateTest,
double defaultReward,
double failReward,
double subgoalReward)
Initializes
|
Modifier and Type | Method and Description |
---|---|
double |
reward(State s,
GroundedAction a,
State sprime)
Returns the reward received when action a is executed in state s and the agent transitions to state sprime.
|
protected StateConditionTest applicableStateTest
protected StateConditionTest subgoalStateTest
protected double subgoalReward
protected double defaultReward
protected double failReward
public LocalSubgoalRF(StateConditionTest subgoalStateTest)
subgoalStateTest
- the subgoal statespublic LocalSubgoalRF(StateConditionTest subgoalStateTest, double defaultReward, double subgoalReward)
subgoalStateTest
- the subgoal statesdefaultReward
- the default rewardsubgoalReward
- the reward returned for transitioning to subgoal statespublic LocalSubgoalRF(StateConditionTest applicableStateTest, StateConditionTest subgoalStateTest)
applicableStateTest
- the applicable states. Transitioning to a non-applicable state causes a reward of failReward
.subgoalStateTest
- the subgoal statespublic LocalSubgoalRF(StateConditionTest applicableStateTest, StateConditionTest subgoalStateTest, double defaultReward, double failReward, double subgoalReward)
applicableStateTest
- Defines the set of states in which the option is applicable. Transitioning to a non-applicable state causes a reward of failReward
.subgoalStateTest
- the subgoal statesdefaultReward
- the default rewardfailReward
- the reward for transitioning to a non-subgoal non-applicable statesubgoalReward
- the reward returned for transitioning to subgoal statespublic double reward(State s, GroundedAction a, State sprime)
RewardFunction
reward
in interface RewardFunction
s
- the state in which the action was executeda
- the action executedsprime
- the state to which the agent transitioned