public static class AgentQSourceMap.MAQLControlledQSourceMap extends java.lang.Object implements AgentQSourceMap
AgentQSourceMap
in which different agent objects each maintain their own personal Q-source.
This is useful if all agents are implementing the same multi-agent learning algorithm so that each agent doesn't have to
replicate the learned Q-values for all other agents; instead only one copy will be kept for each agent. For example,
this can be useful when all agents implement CoCo-Q learning.AgentQSourceMap.HashMapAgentQSourceMap, AgentQSourceMap.MAQLControlledQSourceMap
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.Integer,MultiAgentQLearning> |
qSourceMapping |
Constructor and Description |
---|
MAQLControlledQSourceMap(java.util.List<SGAgent> agents)
Initializes with the list of agents that each keep their own Q-source.
|
Modifier and Type | Method and Description |
---|---|
QSourceForSingleAgent |
agentQSource(int agentNum)
Returns a QSource which can be used to query the Q-values of a given agent.
|
void |
setAgents(java.util.List<MultiAgentQLearning> agents)
Initializes with a list of agents that each keep their own Q_source.
|
protected java.util.Map<java.lang.Integer,MultiAgentQLearning> qSourceMapping
public MAQLControlledQSourceMap(java.util.List<SGAgent> agents)
MultiAgentQLearning
. This constructor accepts a list of
regular agents, however, to make construction easier. An exception will be thrown if all of all of the agents
are not of the right type.agents
- a list of SGAgent
objects, each which is an instance MultiAgentQLearning
.public void setAgents(java.util.List<MultiAgentQLearning> agents)
agents
- a list of MultiAgentQLearning
agents/public QSourceForSingleAgent agentQSource(int agentNum)
AgentQSourceMap
agentQSource
in interface AgentQSourceMap
agentNum
- the agent for whom the qSource is to be providedQSourceForSingleAgent
object that allows the Q-values for a single agent to be queried.