Exemple #1
0
func (this *DepLearner) MakeMappedHistory(parents ParentSet, cutRanges rlglue.IntRanges) (mappedHistory []Histogram) {
	numMappedStates := cutRanges.Count()
	mappedHistory = make([]Histogram, numMappedStates*this.bg.numActions)
	for i := range mappedHistory {
		mappedHistory[i] = make(Histogram, this.bg.numOutcomes)
	}
	for sk, h := range this.history {
		a := uint64(sk) % this.bg.numActions
		s := uint64(sk) / this.bg.numActions
		sv := this.bg.stateValues[s]
		mv := parents.CutValues(sv)
		ms := cutRanges.Index(mv)
		mk := a + this.bg.numActions*ms
		mappedHistory[mk] = mappedHistory[mk].UpdateHistogram(h)
	}
	return
}