public class SGQWActionHistoryFactory extends java.lang.Object implements AgentFactory
Modifier and Type | Field and Description |
---|---|
protected ActionIdMap |
actionMap
An action mapping to map from actions to int values
|
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 ValueFunctionInitialization |
qinit
A default Q-value initializer
|
protected StateHashFactory |
stateHash
The state hashing factory the Q-learning algorithm will use
|
Constructor and Description |
---|
SGQWActionHistoryFactory(SGDomain d,
double discount,
double learningRate,
StateHashFactory stateHash,
int historySize)
Initializes the factory
|
SGQWActionHistoryFactory(SGDomain d,
double discount,
double learningRate,
StateHashFactory stateHash,
int historySize,
int maxPlayers,
ActionIdMap actionMap)
Initializes the factory
|
Modifier and Type | Method and Description |
---|---|
Agent |
generateAgent()
Returns a new agent instance.
|
void |
setEpsilon(double epsilon)
Sets the epislon parmaeter (for epsilon greedy policy).
|
void |
setQValueInitializer(ValueFunctionInitialization qinit)
Sets the Q-value initialization function that will be used by the agent.
|
protected SGDomain domain
protected double discount
protected double learningRate
protected StateHashFactory stateHash
protected int historySize
protected int maxPlayers
protected ActionIdMap actionMap
protected ValueFunctionInitialization qinit
protected double epsilon
public SGQWActionHistoryFactory(SGDomain d, double discount, double learningRate, StateHashFactory stateHash, int historySize, int maxPlayers, ActionIdMap actionMap)
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 remembermaxPlayers
- The maximum number of players that can be in the gameactionMap
- An action mapping to map from actions to int valuespublic SGQWActionHistoryFactory(SGDomain d, double discount, double learningRate, StateHashFactory 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(ValueFunctionInitialization qinit)
qinit
- the Q-value initialization function.public void setEpsilon(double epsilon)
epsilon
- the epsilon value to usepublic Agent generateAgent()
AgentFactory
generateAgent
in interface AgentFactory