public abstract class GraphRF extends java.lang.Object implements RewardFunction
RewardFunction
s for GraphDefinedDomain
Domain
s. This class implements the standard reward(State, Action, State)
method by converting the State
objects to their graph node integer representation and the Action
to its
integer representation and then returning the value of reward(int, int, int)
, which is an abstract method
that the client must implement.Constructor and Description |
---|
GraphRF() |
Modifier and Type | Method and Description |
---|---|
abstract double |
reward(int s,
int a,
int sprime)
Returns the reward for taking action a in state node s and transition to state node sprime.
|
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 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 abstract double reward(int s, int a, int sprime)
s
- the previous state node ida
- the action idsprime
- the next state node id