You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead, what I did, was to introduce a list of ints, [0, 1, 2, 3, 4...] which maps to the items in solution.reqs:
typesolutionstruct {
scheduler*Schedulerreqs []ScheduleRequest// This is the order we are optimizing for. We could in theory really// reorder reqs, but since eaopt requires that slices's interface{} content// is hashable we reorder ints which really are the indexes of reqs.order []int
}
func (s*solution) Crossover(genome eaopt.Genome, rng*rand.Rand) {
// https://www.hindawi.com/journals/cin/2017/7430125/eaopt.CrossCXInt(s.order, genome.(*solution).order)
}
I have a genome which isn't hashable. When I run my application, it panics:
and
Assuming that
interface{}
is hashable is probably a bad idea.The text was updated successfully, but these errors were encountered: