public class LunarLanderRF extends java.lang.Object implements RewardFunction
LunarLanderDomain
. By default, this
reward function returns -1 except when the agent hits the ground, hits an obstacle, hits the side of the landing pad,
or lands on the landing
pad. When the agent hits the ground, obstacle, or side of the landing pad it receives -100. When it lands on the landing pad,
it receives +1000. The rewards for these conditions may also be modified.Modifier and Type | Field and Description |
---|---|
double |
collisionReward
The reward for hitting the ground or an obstacle
|
double |
defaultReward
The default reward received for moving through the air
|
double |
goalReward
The reward for landing on the landing pad
|
protected PropositionalFunction |
onGround |
protected PropositionalFunction |
onPad |
protected PropositionalFunction |
touchingPad |
protected PropositionalFunction |
touchingSurface |
Constructor and Description |
---|
LunarLanderRF(OODomain domain)
Initializes with default reward values (move through air = -1; collision = -100; land on pad = +1000)
|
LunarLanderRF(OODomain domain,
double goalReward,
double collisionReward,
double defaultReward)
Initializes with custom reward condition values.
|
Modifier and Type | Method and Description |
---|---|
double |
getCollisionReward() |
double |
getDefaultReward() |
double |
getGoalReward() |
double |
reward(State s,
Action a,
State sprime)
Returns the reward received when action a is executed in state s and the agent transitions to state sprime.
|
void |
setCollisionReward(double collisionReward) |
void |
setDefaultReward(double defaultReward) |
void |
setGoalReward(double goalReward) |
public double goalReward
public double collisionReward
public double defaultReward
protected PropositionalFunction onGround
protected PropositionalFunction touchingSurface
protected PropositionalFunction touchingPad
protected PropositionalFunction onPad
public LunarLanderRF(OODomain domain)
domain
- a LunarLanderDomain
generated Domain
.public LunarLanderRF(OODomain domain, double goalReward, double collisionReward, double defaultReward)
domain
- a LunarLanderDomain
generated Domain
.goalReward
- the reward for landing on the landing pad.collisionReward
- the reward for a collision.defaultReward
- the default reward for all other states (i.e., moving through the air)public double reward(State s, Action 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 transitionedpublic double getGoalReward()
public void setGoalReward(double goalReward)
public double getCollisionReward()
public void setCollisionReward(double collisionReward)
public double getDefaultReward()
public void setDefaultReward(double defaultReward)