18 lines
261 B
Go
18 lines
261 B
Go
|
package gambit
|
||
|
|
||
|
type Gang struct {
|
||
|
b Bandit
|
||
|
}
|
||
|
|
||
|
func (g *Gang) WithBandit(b Bandit) {
|
||
|
g.b = b
|
||
|
}
|
||
|
|
||
|
func (g *Gang) AllocateSolution() ([]int, []float64) {
|
||
|
a := make([]int, g.b.Size())
|
||
|
b := make([]float64, g.b.Size())
|
||
|
g.b.Count(a)
|
||
|
g.b.Reward(b)
|
||
|
return a, b
|
||
|
}
|