public class EMinMaxPolicy extends MAQSourcePolicy implements EnumerablePolicy
Modifier and Type | Field and Description |
---|---|
protected double |
epsilon
The epsilon parameter specifying how often random joint actions are returned
|
protected MultiAgentQSourceProvider |
qSourceProvider
The multi-agent q-source provider
|
protected int |
targetAgent
The target agent who is maximizing action selection
|
agentsInJointPolicy, agentsSynchronizedSoFar, lastSyncedState, lastSynchronizedJointAction
Constructor and Description |
---|
EMinMaxPolicy(double epsilon)
Initializes for a given epsilon value; the fraction of the time a random joint action is selected
|
EMinMaxPolicy(MultiAgentQLearning actingAgent,
double epsilon,
int targetAgentNum)
Initializes for a given Q-learning agent and epsilon value.
|
Modifier and Type | Method and Description |
---|---|
Action |
action(State s)
This method will return an action sampled by the policy for the given state.
|
double |
actionProb(State s,
Action a)
Returns the probability/probability density that the given action will be taken in the given state.
|
JointPolicy |
copy()
Creates a copy of this joint policy and returns it.
|
boolean |
definedFor(State s)
Specifies whether this policy is defined for the input state.
|
java.util.List<ActionProb> |
policyDistribution(State s)
This method will return action probability distribution defined by the policy.
|
void |
setQSourceProvider(MultiAgentQSourceProvider provider)
Sets the
MultiAgentQSourceProvider that will be used to define this object's joint policy. |
void |
setTargetAgent(int agentNum)
Sets the target privileged agent from which this joint policy is defined.
|
getAgentsInJointPolicy, getAgentSynchronizedActionSelection, getAllJointActions, setAgentsInJointPolicy, setAgentsInJointPolicyFromWorld, setAgentTypesInJointPolicy
protected MultiAgentQSourceProvider qSourceProvider
protected double epsilon
protected int targetAgent
public EMinMaxPolicy(double epsilon)
epsilon
- the espilon parameterpublic EMinMaxPolicy(MultiAgentQLearning actingAgent, double epsilon, int targetAgentNum)
actingAgent
- the Q-learning agentepsilon
- the epsilon parametertargetAgentNum
- the agent number of the target agentpublic void setTargetAgent(int agentNum)
JointPolicy
setTargetAgent
in class JointPolicy
agentNum
- the target agent.public JointPolicy copy()
JointPolicy
copy
in class JointPolicy
public Action action(State s)
Policy
public double actionProb(State s, Action a)
Policy
actionProb
in interface Policy
s
- the state of interesta
- the action that may be taken in the statepublic java.util.List<ActionProb> policyDistribution(State s)
EnumerablePolicy
policyDistribution
in interface EnumerablePolicy
s
- the state for which an action distribution should be returnedpublic boolean definedFor(State s)
Policy
definedFor
in interface Policy
s
- the input state to test for whether this policy is definedState
s, false otherwise.public void setQSourceProvider(MultiAgentQSourceProvider provider)
MAQSourcePolicy
MultiAgentQSourceProvider
that will be used to define this object's joint policy.setQSourceProvider
in class MAQSourcePolicy
provider
- the MultiAgentQSourceProvider
that will be used to define this object's joint policy.