public class SingleGoalPFRF extends java.lang.Object implements RewardFunction
Constructor and Description |
---|
SingleGoalPFRF(PropositionalFunction pf)
Initializes the reward function to return 1 when any grounded from of pf is true in the resulting
state.
|
SingleGoalPFRF(PropositionalFunction pf,
double goalReward,
double nonGoalReward)
Initializes the reward function to return the specified goal reward when any grounded from of pf is true in the resulting
state and the specified non-goal reward otherwise.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public SingleGoalPFRF(PropositionalFunction pf)
pf
- the propositional function that must have a true grounded version for the goal reward to be returned.public SingleGoalPFRF(PropositionalFunction pf, double goalReward, double nonGoalReward)
pf
- the propositional function that must have a true grounded version for the goal reward to be returned.goalReward
- the goal reward value to be returnednonGoalReward
- the non goal reward value to be returned.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 transitioned