func (this *OptAgent) AgentInit(taskString string) { this.task, _ = rlglue.ParseTaskSpec(taskString) this.Cfg.NumSystems = len(this.task.Obs.Ints) this.mdp = NewSysMDP(this.Cfg) this.qt = discrete.NewQTable(this.task.Obs.Ints.Count(), this.task.Act.Ints.Count()) vi.ValueIteration(this.qt, this.mdp, 0.1) }
func (ra *BebAgent) AgentInit(taskString string) { ra.task, _ = rlglue.ParseTaskSpec(taskString) if ra.task.DiscountFactor == 1 { ra.task.DiscountFactor = 0.99 } ra.rmdp = NewBebMDP(ra.task, ra.Cfg) ra.qt = discrete.NewQTable(ra.task.Obs.Ints.Count(), ra.task.Act.Ints.Count()) ra.Cfg.RFoo = ra.GetRFoo(ra.task) ra.rmdp.RFoo = ra.Cfg.RFoo }
func (ra *RmaxAgent) AgentInit(taskString string) { ra.task, _ = rlglue.ParseTaskSpec(taskString) ra.rmdp = NewRmaxMDP(ra.task, ra.Cfg.M) ra.qt = discrete.NewQTable(ra.task.Obs.Ints.Count(), ra.task.Act.Ints.Count()) }