/** * Initializes * @param domain the learning domain * @param gamma the discount factor * @param vfa the value function approximation to use */ public ApproximateQLearning(SADomain domain, double gamma, ParametricFunction.ParametricStateActionFunction vfa) { this(domain, gamma, vfa, new ShallowIdentityStateMapping()); }
/** * Initializes with a default 0.1 epsilon greedy policy/strategy * @param d the domain in which the agent will act * @param discount the discount factor * @param learningRate the learning rate * @param qInitizalizer the Q-value initialization method * @param hashFactory the state hashing factory */ public SGNaiveQLAgent(SGDomain d, double discount, double learningRate, QFunction qInitizalizer, HashableStateFactory hashFactory) { this.init(d); this.discount = discount; this.learningRate = new ConstantLR(learningRate); this.hashFactory = hashFactory; this.qInit = qInitizalizer; this.qMap = new HashMap<HashableState, List<QValue>>(); stateRepresentations = new HashMap<HashableState, State>(); this.policy = new EpsilonGreedy(this, 0.1); this.storedMapAbstraction = new ShallowIdentityStateMapping(); }
/** * Initializes with a default 0.1 epsilon greedy policy/strategy * @param d the domain in which the agent will act * @param discount the discount factor * @param learningRate the learning rate * @param defaultQ the default to which all Q-values will be initialized * @param hashFactory the state hashing factory */ public SGNaiveQLAgent(SGDomain d, double discount, double learningRate, double defaultQ, HashableStateFactory hashFactory) { this.init(d); this.discount = discount; this.learningRate = new ConstantLR(learningRate); this.hashFactory = hashFactory; this.qInit = new ConstantValueFunction(defaultQ); this.qMap = new HashMap<HashableState, List<QValue>>(); stateRepresentations = new HashMap<HashableState, State>(); this.policy = new EpsilonGreedy(this, 0.1); this.storedMapAbstraction = new ShallowIdentityStateMapping(); }
/** * Initializes with a default Q-value of 0 and a 0.1 epsilon greedy policy/strategy * @param d the domain in which the agent will act * @param discount the discount factor * @param learningRate the learning rate * @param hashFactory the state hashing factory */ public SGNaiveQLAgent(SGDomain d, double discount, double learningRate, HashableStateFactory hashFactory) { this.init(d); this.discount = discount; this.learningRate = new ConstantLR(learningRate); this.hashFactory = hashFactory; this.qInit = new ConstantValueFunction(0.); this.qMap = new HashMap<HashableState, List<QValue>>(); stateRepresentations = new HashMap<HashableState, State>(); this.policy = new EpsilonGreedy(this, 0.1); this.storedMapAbstraction = new ShallowIdentityStateMapping(); }