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

Method Energy

primitive/worker.go:46–54  ·  view source on GitHub ↗
(shape Shape, alpha int)

Source from the content-addressed store, hash-verified

44}
45
46func (worker *Worker) Energy(shape Shape, alpha int) float64 {
47 worker.Counter++
48 lines := shape.Rasterize()
49 // worker.Heatmap.Add(lines)
50 color := computeColor(worker.Target, worker.Current, lines, alpha)
51 copyLines(worker.Buffer, worker.Current, lines)
52 drawLines(worker.Buffer, color, lines)
53 return differencePartial(worker.Target, worker.Current, worker.Buffer, worker.Score, lines)
54}
55
56func (worker *Worker) BestHillClimbState(t ShapeType, a, n, age, m int) *State {
57 var bestEnergy float64

Callers

nothing calls this directly

Calls 5

computeColorFunction · 0.85
copyLinesFunction · 0.85
drawLinesFunction · 0.85
differencePartialFunction · 0.85
RasterizeMethod · 0.65

Tested by

no test coverage detected