Implemented agent which chooses to play winning, losing or random moves by solving a simplified MDP model of the game using policy iteration.
Portions of MDP/solver code by Ciaran O'Reilly and Ravi Mohan used under MIT license.
This commit is contained in:
21
src/aima/core/probability/mdp/RewardFunction.java
Normal file
21
src/aima/core/probability/mdp/RewardFunction.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package aima.core.probability.mdp;
|
||||
|
||||
/**
|
||||
* An interface for MDP reward functions.
|
||||
*
|
||||
* @param <S>
|
||||
* the state type.
|
||||
* @author Ciaran O'Reilly
|
||||
* @author Ravi Mohan
|
||||
*/
|
||||
public interface RewardFunction<S> {
|
||||
|
||||
/**
|
||||
* Get the reward associated with being in state s.
|
||||
*
|
||||
* @param s
|
||||
* the state whose award is sought.
|
||||
* @return the reward associated with being in state s.
|
||||
*/
|
||||
double reward(S s);
|
||||
}
|
||||
Reference in New Issue
Block a user