public class SGNaiveQFactory extends java.lang.Object implements AgentFactory
SGNaiveQLAgent
s.Modifier and Type | Field and Description |
---|---|
protected double |
defaultQ
The default Q-value to which Q-values will be initialized
|
protected double |
discount
The discount rate the Q-learning algorithm will use
|
protected SGDomain |
domain
The stochastic games domain in which the agent will act
|
protected double |
learningRate
The learning rate the Q-learning algorithm will use
|
protected HashableStateFactory |
stateHash
The state hashing factory the Q-learning algorithm will use
|
protected StateMapping |
storedAbstraction
The state abstract the Q-learning algorithm will use
|
Constructor and Description |
---|
SGNaiveQFactory(SGDomain domain,
double discount,
double learningRate,
double defaultQ,
HashableStateFactory stateHash)
Initializes the factory.
|
SGNaiveQFactory(SGDomain domain,
double discount,
double learningRate,
double defaultQ,
HashableStateFactory stateHash,
StateMapping storedAbstraction)
Initializes the factory.
|
Modifier and Type | Method and Description |
---|---|
SGAgent |
generateAgent(java.lang.String agentName,
SGAgentType type)
Generates a new
SGAgent |
void |
setStoredAbstraction(StateMapping abs)
Sets the factory to provide Q-learning algorithms with the given state abstraction.
|
protected SGDomain domain
protected double discount
protected double learningRate
protected double defaultQ
protected HashableStateFactory stateHash
protected StateMapping storedAbstraction
public SGNaiveQFactory(SGDomain domain, double discount, double learningRate, double defaultQ, HashableStateFactory stateHash)
domain
- The stochastic games domain in which the agent will actdiscount
- The discount rate the Q-learning algorithm will uselearningRate
- The learning rate the Q-learning algorithm will usedefaultQ
- The default Q-value to which Q-values will be initializedstateHash
- The state hashing factory the Q-learning algorithm will usepublic SGNaiveQFactory(SGDomain domain, double discount, double learningRate, double defaultQ, HashableStateFactory stateHash, StateMapping storedAbstraction)
domain
- The stochastic games domain in which the agent will actdiscount
- The discount rate the Q-learning algorithm will uselearningRate
- The learning rate the Q-learning algorithm will usedefaultQ
- The default Q-value to which Q-values will be initializedstateHash
- The state hashing factory the Q-learning algorithm will usestoredAbstraction
- the state abstraction the Q-learning algorithm will usepublic void setStoredAbstraction(StateMapping abs)
abs
- the state abstraction to usepublic 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