public class MAQLFactory extends java.lang.Object implements AgentFactory
MultiAgentQLearning
agents. Subclasses for specific kinds of multi-agent Q-learning are also included.
The policy given to this factory is always copied when generating a new agent to ensure that multiple agents generated from the same factory
have unique policies tailored to their perspective.Modifier and Type | Class and Description |
---|---|
static class |
MAQLFactory.CoCoQLearningFactory
Factory for generating CoCo-Q agents.
|
static class |
MAQLFactory.MAMaxQLearningFactory
Factory for generating Max multiagent Q-learning agents.
|
Modifier and Type | Field and Description |
---|---|
protected SGBackupOperator |
backupOperator |
protected double |
discount |
protected SGDomain |
domain |
protected HashableStateFactory |
hashingFactory |
protected PolicyFromJointPolicy |
learningPolicy |
protected LearningRate |
learningRate |
protected QFunction |
qInit |
protected boolean |
queryOtherAgentsQSource |
Constructor and Description |
---|
MAQLFactory()
Empty constructor.
|
MAQLFactory(SGDomain d,
double discount,
double learningRate,
HashableStateFactory hashFactory,
double qInit,
SGBackupOperator backupOperator,
boolean queryOtherAgentsForTheirQValues)
Initializes.
|
MAQLFactory(SGDomain d,
double discount,
LearningRate learningRate,
HashableStateFactory hashFactory,
QFunction qInit,
SGBackupOperator backupOperator,
boolean queryOtherAgentsForTheirQValues,
PolicyFromJointPolicy learningPolicy)
Initializes.
|
Modifier and Type | Method and Description |
---|---|
SGAgent |
generateAgent(java.lang.String agentName,
SGAgentType type)
Generates a new
SGAgent |
void |
init(SGDomain d,
double discount,
LearningRate learningRate,
HashableStateFactory hashFactory,
QFunction qInit,
SGBackupOperator backupOperator,
boolean queryOtherAgentsForTheirQValues,
PolicyFromJointPolicy learningPolicy)
Initializes.
|
protected SGDomain domain
protected double discount
protected LearningRate learningRate
protected QFunction qInit
protected HashableStateFactory hashingFactory
protected SGBackupOperator backupOperator
protected PolicyFromJointPolicy learningPolicy
protected boolean queryOtherAgentsQSource
public MAQLFactory()
init(SGDomain, double, LearningRate, burlap.statehashing.HashableStateFactory, burlap.behavior.valuefunction.QFunction, SGBackupOperator, boolean, PolicyFromJointPolicy)
function
after construction.public MAQLFactory(SGDomain d, double discount, double learningRate, HashableStateFactory hashFactory, double qInit, SGBackupOperator backupOperator, boolean queryOtherAgentsForTheirQValues)
d
- the domain in which to perform learingdiscount
- the discount factorlearningRate
- the constant learning ratehashFactory
- the hashing factory used to index states and Q-valuesqInit
- the default Q-value to which all initial Q-values will be initializedbackupOperator
- the backup operator to use that defines the solution concept being learnedqueryOtherAgentsForTheirQValues
- it true, then the agent uses the Q-values for other agents that are stored by them; if false then the agent stores a Q-value for each other agent in the world.public MAQLFactory(SGDomain d, double discount, LearningRate learningRate, HashableStateFactory hashFactory, QFunction qInit, SGBackupOperator backupOperator, boolean queryOtherAgentsForTheirQValues, PolicyFromJointPolicy learningPolicy)
d
- the domain in which to perform learingdiscount
- the discount factorlearningRate
- the learning rate functionhashFactory
- the hashing factory used to index states and Q-valuesqInit
- the Q-value initialization functionbackupOperator
- the backup operator to use that defines the solution concept being learnedqueryOtherAgentsForTheirQValues
- it true, then the agent uses the Q-values for other agents that are stored by them; if false then the agent stores a Q-value for each other agent in the world.learningPolicy
- the learningPolicy to followpublic void init(SGDomain d, double discount, LearningRate learningRate, HashableStateFactory hashFactory, QFunction qInit, SGBackupOperator backupOperator, boolean queryOtherAgentsForTheirQValues, PolicyFromJointPolicy learningPolicy)
d
- the domain in which to perform learingdiscount
- the discount factorlearningRate
- the learning rate functionhashFactory
- the hashing factory used to index states and Q-valuesqInit
- the Q-value initialization functionbackupOperator
- the backup operator to use that defines the solution concept being learnedqueryOtherAgentsForTheirQValues
- it true, then the agent uses the Q-values for other agents that are stored by them; if false then the agent stores a Q-value for each other agent in the world.learningPolicy
- the learningPolicy to followpublic SGAgent generateAgent(java.lang.String agentName, SGAgentType type)
AgentFactory
SGAgent
generateAgent
in interface AgentFactory
agentName
- the name for the agenttype
- the SGAgentType
for the agentSGAgent