
An S4 class to represent model/scenario planning horizon with intervals (year-steps)
Source:R/class-horizon.R
class-horizon.RdAn S4 class to represent model/scenario planning horizon with intervals (year-steps)
Slots
namecharacter. Name of the horizon object. Used to distinguish between different horizons in the model or scenario, including the automatic creation of the folder name for the model/scenario scripts.
desccharacter. Description of the horizon object, for own references.
periodinteger. A planning period defined as a sequence of years (arranged, without gaps) of the model planning (e.g. optimization) window. Data with years before or after the planning
periodcan present in the model-objects and will be taken into account during interpolation of the model parameters.intervalsdata.frame. Data frame with the start, middle, and end year of every modelled interval, plus an optional display
label.start,midandendare integer years;midis the milestone and the model's key for the period.labelis a character display name, unique across intervals, filled frommidwhen not given, and rendered fiscally (FY2025-26) when the calendar carries a non-Januaryyear_start. The label is presentation only and never reaches the solver – seeyear_label().An optional
calendarcolumn names the calendar that milestone is solved on, taken fromconfig@misc$calendars;NA, or no column at all, means the model calendar, which is every horizon written before per-year calendars existed. Write it withsetCalendar(mod, cal, years = ...), which also checks that the calendar is a sample of the model's.An optional
weightcolumn is the YEAR half of the objective weight: how much that milestone's costs count ineqObjective. It multiplies the region half (config@objweight) intopObjWeight[region, year].NA, or no column at all, means 1. Its purpose is a milestone whose cost estimate deserves less trust – typically one solved on a SAMPLE of the model calendar between two fully resolved milestones, where the year still carries full-year cost at full period weight and would otherwise dominate the sum. Strictly positive; the weight scales the whole cost cell, so no trade-off inside the year changes. Write it withsetObjectiveWeights(mod, years = ...).base_yearinteger. Optional single milestone year that is GIVEN rather than decided. The marked year is interpolated as any other year but is not passed to the solver – its own solution comes from a separate solve (
solve_base_year()) and what it decided can be carried into the projection as sunk stock. Milestones BEFORE it are historical and enter no LP at all. Both still anchor interpolation, which reads the anchor years present in the data rather than the milestone list. Empty when every milestone is optimised. Seesolve_base_year().misclist. Any additional data or information to store in the object.