add javadoc
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
package core.policy;
|
||||
|
||||
/**
|
||||
* Chooses the action with the highest values with possibility: 1-Ɛ + Ɛ/|A|
|
||||
* With possibility of Ɛ, a random action is taken (highest values option included).
|
||||
*
|
||||
* @param <A> Enum class of available action in specific environment
|
||||
*/
|
||||
public interface EpsilonPolicy<A extends Enum> extends Policy<A> {
|
||||
float getEpsilon();
|
||||
void setEpsilon(float epsilon);
|
||||
|
||||
@@ -6,6 +6,12 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Always chooses the action with the highest value
|
||||
* with ties broken arbitrarily.
|
||||
*
|
||||
* @param <A> Enum class of available action in specific environment
|
||||
*/
|
||||
public class GreedyPolicy<A extends Enum> implements Policy<A> {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,6 +2,12 @@ package core.policy;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Strategy to choose a specific action available in the agent's current
|
||||
* state.
|
||||
*
|
||||
* @param <A> Enum class of available action in specific environment
|
||||
*/
|
||||
public interface Policy<A extends Enum> {
|
||||
A chooseAction(Map<A, Double> actionValues);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,11 @@ import core.RNG;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Chooses an action arbitrarily.
|
||||
*
|
||||
* @param <A> Enum class of available action in specific environment
|
||||
*/
|
||||
public class RandomPolicy<A extends Enum> implements Policy<A>{
|
||||
@Override
|
||||
public A chooseAction(Map<A, Double> actionValues) {
|
||||
|
||||
Reference in New Issue
Block a user