chore: limit optimizer to 2 days horizon
This commit is contained in:
parent
f69252e672
commit
f126c8c70b
1 changed files with 5 additions and 2 deletions
|
|
@ -119,8 +119,11 @@ func (site *Site) optimizerUpdate(battery []types.Measurement) error {
|
|||
if solarTariff != nil && len(solar) > 0 {
|
||||
minLen = min(minLen, len(solar))
|
||||
}
|
||||
const expectedSlots = 8
|
||||
if minLen < expectedSlots {
|
||||
|
||||
// limit to 2 days for sake of performance
|
||||
minLen = min(96, minLen)
|
||||
|
||||
if expectedSlots := 8; minLen < expectedSlots {
|
||||
if solarTariff != nil {
|
||||
return fmt.Errorf("not enough forecast slots for meaningful optimization: %d < %d (grid=%d, feedIn=%d, solar=%d)", minLen, expectedSlots, len(grid), len(feedIn), len(solar))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue