public static class CartPoleDomain.CartPoleRewardFunction extends java.lang.Object implements RewardFunction
Constructor and Description |
---|
CartPoleDomain.CartPoleRewardFunction()
Initializes with max pole angle threshold of 12 degrees (about 0.2 radians)
|
CartPoleDomain.CartPoleRewardFunction(double maxAbsoluteAngleInRadians)
Initializes with a max pole angle as specified in radians
|
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.
|
public CartPoleDomain.CartPoleRewardFunction()
public CartPoleDomain.CartPoleRewardFunction(double maxAbsoluteAngleInRadians)
maxAbsoluteAngleInRadians
- the maximum pole angle that causes task failure.public 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