Commit b0884964 authored by Topi Rasku's avatar Topi Rasku
Browse files

Fixing the way the forecast horizon behaves.

parent c7cc9923
......@@ -172,10 +172,16 @@ tCounter = 1;
cc(counter)${ mInterval(mSolve, 'stepsPerInterval', counter) }
= yes;
// Update tForecastNext
tForecastNext(mSolve)
${ tSolveFirst >= tForecastNext(mSolve) }
= tForecastNext(mSolve) + mSettings(mSolve, 't_forecastJump');
// Calculate forecast length
currentForecastLength
= min( mSettings(mSolve, 't_forecastLengthUnchanging'), // Unchanging forecast length would remain the same
= max( mSettings(mSolve, 't_forecastLengthUnchanging'), // Unchanging forecast length would remain the same
mSettings(mSolve, 't_forecastLengthDecreasesFrom') - [mSettings(mSolve, 't_forecastJump') - {tForecastNext(mSolve) - tSolveFirst}] // While decreasing forecast length has a fixed horizon point and thus gets shorter
); // Smallest forecast horizon is selected
); // Larger forecast horizon is selected
// Is there any case where t_forecastLength should be larger than t_horizon? Could happen if one doesn't want to join forecasts at the end of the solve horizon.
// If not, add a check for currentForecastLength <= mSettings(mSolve, 't_horizon')
......
......@@ -25,8 +25,8 @@ putclose log;
// Determine the necessary horizon for updating data
option clear = tmp;
tmp = max( mSettings(mSolve, 't_forecastLengthUnchanging') + mSettings(mSolve, 't_forecastJump'),
mSettings('schedule', 't_forecastLengthDecreasesFrom')
tmp = max( mSettings(mSolve, 't_forecastLengthUnchanging'),
mSettings(mSolve, 't_forecastLengthDecreasesFrom')
);
// Find time steps until the forecast horizon
......@@ -35,7 +35,7 @@ tt_forecast(t_current(t))
${ ord(t) <= tSolveFirst + tmp }
= yes;
if (ord(tSolve) >= tForecastNext(mSolve),
if (ord(tSolve) >= tForecastNext(mSolve) - mSettings(mSolve, 't_forecastJump'), // tForecastNext updated already in periodicLoop!
// Update ts_unit
if (mTimeseries_loop_read(mSolve, 'ts_unit'),
......@@ -138,9 +138,6 @@ $offtext
= ts_unavailability_update(unit, t);
); // END if('ts_unavailability')
// Update the next forecast
tForecastNext(mSolve)
= tForecastNext(mSolve) + mSettings(mSolve, 't_forecastJump');
); // END if(tForecastNext)
* =============================================================================
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment