public class SGQWActionHistoryFactory extends java.lang.Object implements AgentFactory
Modifier and Type | Field and Description |
---|---|
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 |
epsilon
The epislon value for epislon greedy policy.
|
protected int |
historySize
How much history the agent should remember
|
protected double |
learningRate
The learning rate the Q-learning algorithm will use
|
protected int |
maxPlayers
The maximum number of players that can be in the game
|
protected QFunction |
qinit
A default Q-value initializer
|
protected HashableStateFactory |
stateHash
The state hashing factory the Q-learning algorithm will use
|
Constructor and Description |
---|
SGQWActionHistoryFactory(SGDomain d,
double discount,
double learningRate,
HashableStateFactory stateHash,
int historySize)
Initializes the factory
|
Modifier and Type | Method and Description |
---|---|
SGAgent |
generateAgent(java.lang.String agentName,
SGAgentType type)
Generates a new
SGAgent |
void |
setEpsilon(double epsilon)
Sets the epislon parmaeter (for epsilon greedy policy).
|
void |
setQValueInitializer(QFunction qinit)
Sets the Q-value initialization function that will be used by the agent.
|
protected SGDomain domain
protected double discount
protected double learningRate
protected HashableStateFactory stateHash
protected int historySize
protected int maxPlayers
protected QFunction qinit
protected double epsilon
public SGQWActionHistoryFactory(SGDomain d, double discount, double learningRate, HashableStateFactory stateHash, int historySize)
d
- 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 usestateHash
- The state hashing factory the Q-learning algorithm will usehistorySize
- How much history the agent should rememberpublic void setQValueInitializer(QFunction qinit)
qinit
- the Q-value initialization function.public void setEpsilon(double epsilon)
epsilon
- the epsilon value 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