4ac3c171ec
This commit makes the weightedChoice algorithm take a slice of weights instead of a map of node scores. This let us avoid costly map allocation and iteration. In addition we make the chooseN algorithm keep track of the remaining nodes by keeping a slice of weights through its entire run, similarly avoiding costly map allocation and iteration. In total this brings the runtime of the TestChooseNSample testcase down from ~73s to ~3.6s. |
||
---|---|---|
.. | ||
agent_test.go | ||
agent.go | ||
choice_test.go | ||
choice.go | ||
graph.go | ||
heuristic_constraints.go | ||
interface.go | ||
log.go | ||
manager.go | ||
prefattach_test.go | ||
prefattach.go |