The counterpart of class-parameter: a parameter carries the model's input
data, a variable its solved output. Every variable declared by the model
has one of these, pre-populated from the baked specification when a modOut
is created and filled with solved values by read_solution() – exactly as
modInp@parameters is populated from data-raw/modInp.yml.
The specification itself is composed at build time in data-raw/DATASET.R:
dimensions, gating map and description come from the GAMS source via gams2x,
the emitted column names and the positive/free declaration are parsed out of
glpk/energyRt.mod, and role / unit / origin come from the
data-raw/variables.yml overlay.
The class and its methods are not intended for direct use; read values with
getData().
Slots
namecharacter, the variable's name in the model.
desccharacter, one-line description.
dimSetscharacter, the variable's dimensions as the model declares them, duplicates preserved (
vTradeIristrade, comm, region, region, year, slice). Byte-identical to.variable_set, whichnewCosts()andnewConstraint()consume positionally against the GAMS declaration.colNamescharacter, the column names the variable is actually written out with. Differs from
dimSetsonly where a dimension repeats and the writers disambiguate it –src/dstforvTradeIr,yearpforvTechRetiredNewCap.gatecharacter, the name of the map that gates the variable's domain (the
$-condition), or""when it is unconditional.rolecharacter, what the variable is:
source,sink,flow,activity,balance,stock,capacityorcost. Astockis a level at a point in time and is never summed over slices.unitcharacter, the KIND of quantity (
commodity,activity,capacity,currency), not a unit string – real units are per-object here and are resolved against the model.positivelogical, whether the model declares the variable non-negative.
origincharacter,
solverorcomputed(built in R byread.R, so never expected in solver output).datadata.frame, the solved values.
misclist,
path/inMemory/onDiskwhen stored on disk.
See also
Other variable:
get_variable()
