revrt.models.routing.RoutingCostLayer#

class RoutingCostLayer(*, layer_name: str, multiplier_layer: MultiplierLayerInput = None, multiplier_scalar: float = 1, is_invariant: bool = False, include_in_final_cost: bool = True, include_in_report: bool = True, apply_row_mult: bool = False, apply_polarity_mult: bool = False)[source]#

Bases: BaseModel

Config for one cost layer in a routing option

Cost layers are summed to build the routing cost surface for an option. Each layer may be rescaled before aggregation and may also opt out of final-cost reporting while still influencing routing.

The rest of this docstring is inserted by Pydantic and can be ignored.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Methods

Attributes

layer_name

Name of layer in layered file containing cost data

multiplier_layer

Optional spatial multiplier layer(s) applied before summation

multiplier_scalar

Optional scalar multiplier applied before summation

is_invariant

Skip path-length scaling when True

include_in_final_cost

Include this layer in final route cost output when True

include_in_report

Report this layer's cost and distance outputs if True

apply_row_mult

Apply the transmission row_width multiplier when True

apply_polarity_mult

Apply the voltage and polarity multiplier when True

layer_name: str#

Name of layer in layered file containing cost data

multiplier_layer: MultiplierLayerInput#

Optional spatial multiplier layer(s) applied before summation

A string or iterable is accepted and normalized to a list. All supplied layers are multiplied together.

multiplier_scalar: float#

Optional scalar multiplier applied before summation

is_invariant: bool#

Skip path-length scaling when True

Use this for layers whose values are already lump-sum route costs, such as fixed-dollar costs to cross into a region.

include_in_final_cost: bool#

Include this layer in final route cost output when True

include_in_report: bool#

Report this layer’s cost and distance outputs if True

apply_row_mult: bool#

Apply the transmission row_width multiplier when True

The routing table input should resolve a voltage value for each routing option, either from the shared voltage column or from voltage_<option> column. The row_width dictionary may specify one multiplier for every option at a voltage, such as {"138": 1.15}, or values by routing option, such as {"500": {"overhead": 1.15, "underground": 2}}. An option value may instead map spatial layer names to scalar values. For example, {"500": {"underground": {"rural": 2, "urban": 20}}} produces one cost term per spatial layer. Existing multiplier_layer inputs apply to every generated term. Every resolved voltage must be listed. For an option mapping, every routing option using this multiplier must be listed.

apply_polarity_mult: bool#

Apply the voltage and polarity multiplier when True

The routing table input should resolve both a voltage and a polarity value for each routing option, either from shared columns or from voltage_<option> / polarity_<option> columns, and the transmission config must provide each combination in voltage_polarity_mult. A scalar polarity value applies to every routing option. To define values per routing option, use a mapping of routing-option names to scalar values. A routing-option value may instead map spatial layer names to scalar values. In that case, each layer is expanded into one cost term per spatial layer. For example, {"500": {"dc": {"underground": {"rural": 50, "urban": 60}}}} produces terms weighted by 50 * rural and 60 * urban. Existing multiplier_layer inputs apply to each generated term.

Important

The configured multiplier is assumed to be in million dollars per mile and is converted to dollars per pixel before being applied.