Generic, reflective accessor that walks every slot of an S4 model object
(except misc) and gathers the regions it refers to. Regions are read from:
any atomic slot named
region,src, ordst, andthe
region,src, anddstcolumns of anydata.frameslot.
Details
The result is the set of unique, non-missing, non-empty region labels. The
function is intentionally schema-agnostic so it keeps working as region
information is added to classes that do not yet carry an explicit @region
slot (e.g. import / export).
See also
Other model:
find_in_model(),
get_weather()
Examples
ek <- topia$modules$electricity$R3
mod <- newModel("TOPIA", data = ek$repo,
calendar = topia$modules$calendars$s4_h24,
region = ek$regions,
horizon = topia$modules$horizons$base,
discount = 0.05)
mod <- setGeoscale(mod, ek$geoscale)
get_region(mod)
#> [1] "W1" "W2" "C1"
