Commit 939e58e1 authored by Erkka Rinne's avatar Erkka Rinne
Browse files

Changed behaviour of `mSetting` 't_perfectForesight' so that it’s defined from...

Changed behaviour of `mSetting` 't_perfectForesight' so that it’s defined from zero (not after 't_jump')

The setting does not have any effect if 't_perfectForesight' is less than 't_jump'.
parent 41c4006b
......@@ -2,6 +2,11 @@
All notable changes to this project will be documented in this file.
## [Unreleased]
## Added
- New model setting 't_perfectForesight' tells the number of time steps (from
the beginning of current solve) for which realized data is used instead of
forecasts. This value cannot exceed current forecast length, however. Setting
the value lower than 't_jump' has no effect.
## [1.0.6] - 2019-03-27
### Fixed
......
......@@ -107,7 +107,7 @@ if (mType('schedule'),
mSettings('schedule', 't_forecastStart') = 1; // At which time step the first forecast is available ( 1 = t000001 )
mSettings('schedule', 't_forecastLengthUnchanging') = 36; // Length of forecasts in time steps - this does not decrease when the solve moves forward (requires forecast data that is longer than the horizon at first)
mSettings('schedule', 't_forecastLengthDecreasesFrom') = 168; // Length of forecasts in time steps - this decreases when the solve moves forward until the new forecast data is read (then extends back to full length)
mSettings('schedule', 't_perfectForesight') = 0; // How many time steps after t_jump there is perfect foresight
mSettings('schedule', 't_perfectForesight') = 0; // How many time steps after there is perfect foresight (including t_jump)
mSettings('schedule', 't_forecastJump') = 24; // How many time steps before new forecast is available
mSettings('schedule', 't_improveForecast') = 0; // Number of time steps ahead of time that the forecast is improved on each solve.
......
......@@ -50,7 +50,7 @@ Sets
t_forecastStart, // Time step for first reading the forecasts (not necessarily t_start)
t_forecastJump, // Number of time steps between each update of the forecasts
t_improveForecast "Number of time steps ahead of time on which the forecast is improved on each solve"
t_perfectForesight "Number of time steps *after* t_jump for which realized data is used instead of forecasts"
t_perfectForesight "Number of time steps for which realized data is used instead of forecasts"
onlyExistingForecasts "Use only existing forecast values when reading updated forecasts. Note: zero values need to be saved as Eps in the gdx file."
scenarios "Number of long-term scenarios used"
scenarioLength "Length of scenario in time steps for creating stocahstic scenarios from time series data"
......
......@@ -624,11 +624,11 @@ loop(msf(m, s, f)${ mf_realization(m, f) },
loop(m, // Not ideal, but multi-model functionality is not yet implemented
* --- Prefect foresight not longer than forecast length
if(mSettings(m, 't_jump') + mSettings(m, 't_perfectForesight')
if(mSettings(m, 't_perfectForesight')
> max(mSettings(m, 't_forecastLengthUnchanging'),
mSettings(m, 't_forecastLengthDecreasesFrom')),
put log "!!! Error in model ", m.tl:0 /;
put log "!!! Error: t_jump + t_perfectForesight > max(t_forecastLengthUnchanging, t_forecastLengthDecreasesFrom)"/;
put log "!!! Error: t_perfectForesight > max(t_forecastLengthUnchanging, t_forecastLengthDecreasesFrom)"/;
abort "Period of perfect foresight cannot be longer than forecast horizon";
);
......
......@@ -231,15 +231,17 @@ loop(cc(counter),
// Determine the combinations of forecasts and intervals
// Include the t_jump for the realization
mft(mf(mSolve, f_solve), tt_interval(t))
${ord(t) <= tSolveFirst + mSettings(mSolve, 't_jump')
+ mSettings(mSolve, 't_perfectForesight')
${ord(t) <= tSolveFirst + max(mSettings(mSolve, 't_jump'),
min(mSettings(mSolve, 't_perfectForesight'),
currentForecastLength))
and mf_realization(mSolve, f_solve)
} = yes;
// Include the full horizon for the central forecast
mft(mf(mSolve, f_solve), tt_interval(t))
${ord(t) > tSolveFirst + mSettings(mSolve, 't_jump')
+ mSettings(mSolve, 't_perfectForesight')
${ord(t) > tSolveFirst + max(mSettings(mSolve, 't_jump'),
min(mSettings(mSolve, 't_perfectForesight'),
currentForecastLength))
and (mf_central(mSolve, f_solve)
or mSettings(mSolve, 'forecasts') = 0)
} = yes;
......@@ -248,8 +250,9 @@ loop(cc(counter),
mft(mf(mSolve, f_solve), tt_interval(t))
${not mf_central(mSolve, f_solve)
and not mf_realization(mSolve, f_solve)
and ord(t) > tSolveFirst + mSettings(mSolve, 't_jump')
+ mSettings(mSolve, 't_perfectForesight')
and ord(t) > tSolveFirst + max(mSettings(mSolve, 't_jump'),
min(mSettings(mSolve, 't_perfectForesight'),
currentForecastLength))
and ord(t) <= tSolveFirst + currentForecastLength
} = yes;
......@@ -417,8 +420,9 @@ dt(t)${sum(ms(mSolve, s)$(not ms_central(mSolve, s)), mst_start(mSolve, s, t))}
// Forecast index displacement between realized and forecasted intervals
// NOTE! This set cannot be reset without references to previously solved time steps in the stochastic tree becoming ill-defined!
df(f_solve(f), t_active(t))${ ord(t) <= tSolveFirst + mSettings(mSolve, 't_jump')
+ mSettings(mSolve, 't_perfectForesight')}
df(f_solve(f), t_active(t))${ ord(t) <= tSolveFirst + max(mSettings(mSolve, 't_jump'),
min(mSettings(mSolve, 't_perfectForesight'),
currentForecastLength))}
= sum(mf_realization(mSolve, f_), ord(f_) - ord(f));
// Central forecast for the long-term scenarios comes from a special forecast label
if(mSettings(mSolve, 'scenarios'),
......
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