Skip to contents

A geoscale describes the model's regions – their nesting into coarser levels, their weights, and optionally their geometry. It is built with the geoscales package and is used for plotting, reporting and subsetting only: attaching one never changes the optimisation model.

Usage

# S4 method for class 'config'
setGeoscale(obj, geoscale, ...)

# S4 method for class 'config'
getGeoscale(obj, ...)

# S4 method for class 'model'
setGeoscale(obj, geoscale, ...)

# S4 method for class 'model'
getGeoscale(obj, ...)

# S4 method for class 'scenario'
setGeoscale(obj, geoscale, ...)

# S4 method for class 'scenario'
getGeoscale(obj, ...)

# S4 method for class 'config'
getCalendar(obj)

# S4 method for class 'model'
getCalendar(obj)

# S4 method for class 'scenario'
getCalendar(obj)

Arguments

obj

A config, settings, model or scenario.

geoscale

A geoscales::Geoscale, or NULL to clear it.

...

Unused.

Value

setGeoscale() returns the modified object; getGeoscale() returns a geoscales::Geoscale or NULL.

Details

setGeoscale() stores it on a config (and therefore on a settings, which inherits from config) or on a model. getGeoscale() reads it back; for a scenario it reads @settings first and falls back to the model's @config, matching how @calendar is resolved.

Examples

if (FALSE) { # \dontrun{
gs <- geoscales::geoscale_from_leaves(
  data.frame(zone = c("N", "N", "S"), region = c("R1", "R2", "R3")),
  levels = c("zone", "region")
)
mod <- newModel("demo", region = c("R1", "R2", "R3"), geoscale = gs)
getGeoscale(mod)
} # }