Skip to content

Commit 45b3896

Browse files
committed
fix: use current solar production for current hour forecast
1 parent b807b8b commit 45b3896

2 files changed

Lines changed: 1 addition & 14 deletions

File tree

‎mpc/mpc.go‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -309,17 +309,3 @@ func (mpc *Controller) isFeasible(dec ControlDecision) bool {
309309
}
310310
return true
311311
}
312-
313-
// ExecuteControl applies the first decision and returns it
314-
func (mpc *Controller) ExecuteControl(forecast []TimeSlot) *ControlDecision {
315-
decisions := mpc.Optimize(forecast)
316-
if len(decisions) == 0 {
317-
return nil
318-
}
319-
320-
// Execute first decision
321-
decision := decisions[0]
322-
mpc.CurrentSOC = decision.BatterySOC
323-
324-
return &decision
325-
}

‎scheduler/mpc.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ func (s *MinerScheduler) getSolarForecast(config *Config, now time.Time, weather
267267
WeatherSymbol: weatherSymbol,
268268
}
269269
}
270+
solarForecast[0] = currentPVPower
270271

271272
return solarForecast, weatherData, nil
272273
}

0 commit comments

Comments
 (0)