code: def energy(self):
          
          arr = self.src.copy()
          arr = self.apply_color(arr, self.state)
  
          scores = [histogram_distance(self.ref[i], arr[i]) for i in range(3)]
  
          # Important: scale by 100 for readability
          return sum(scores) * 100
docs: Calculate state's energy.