MCPcopy
hub / github.com/fogleman/primitive / PreAnneal

Function PreAnneal

primitive/optimize.go:36–47  ·  view source on GitHub ↗
(state Annealable, iterations int)

Source from the content-addressed store, hash-verified

34}
35
36func PreAnneal(state Annealable, iterations int) float64 {
37 state = state.Copy()
38 previous := state.Energy()
39 var total float64
40 for i := 0; i < iterations; i++ {
41 state.DoMove()
42 energy := state.Energy()
43 total += math.Abs(energy - previous)
44 previous = energy
45 }
46 return total / float64(iterations)
47}
48
49func Anneal(state Annealable, maxTemp, minTemp float64, steps int) Annealable {
50 factor := -math.Log(maxTemp / minTemp)

Callers

nothing calls this directly

Calls 3

CopyMethod · 0.65
EnergyMethod · 0.65
DoMoveMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…