API Reference
This page groups the public API exported by Nosy. For a narrative introduction, see Modelling Concepts and Examples.
Simulation And Optimisation
Nosy.TimeMesh — Type
TimeMesh(w::Vector; circular::Bool=true)Return a TimeMesh based on the timestep weight vector w. All weights must be positive rational or integer values, and their sum must be an integer. Time meshes are circular by default. Pass circular=false to make associated time series reject out-of-bounds indexing instead of wrapping around.
TimeMesh(; circular::Bool=true)Return a TimeMesh based on the a 8760 1-hour timesteps. Time meshes are circular by default. Pass circular=false to make associated time series reject out-of-bounds indexing instead of wrapping around.
Nosy.model — Function
model(s::Sim)Return the JuMP model of the simulation for a single-level problem.
model(c::Component)Return the model built for component c.
Nosy.lowermodel — Function
lowermodel(s::Sim)Return the lower model of a Bilevel problem or the model itself for a single-level problem.
Nosy.uppermodel — Function
uppermodel(s::Sim)Return the upper model of a Bilevel problem or the model itself for a single-level problem.
Nosy.Snapshot — Type
Snapshot(sim::Sim, options::AbstractDict{Symbol,<:Any}=Dict{Symbol,Any}())Create a Snapshot for simulation sim with options options. Options from sim are merged with options, and an error is thrown if there are duplicate keys.
Nosy.finalize! — Function
finalize!(s::Snapshot)Finalize the system:
- add node losses
- check all ports of connected components are connected
- apply system and node constraints
- fix variables with very low bounds
Nosy.optimize! — Function
optimize!(snapshots, obj::Union{GenericAffExpr,Number})Optimise snapshots sharing the same simulation. snapshots accepts either one Snapshot or an AbstractVector of Snapshots. This function modifies the underlying simulation model and does not return a Snapshot. Thresholds are read from sim(s).options.
optimize!(snapshots, lowerobj::Union{GenericAffExpr,Number}, upperobj::Union{GenericAffExpr,Number})Optimise snapshots sharing the same simulation using bilevel optimisation. snapshots accepts either one Snapshot or an AbstractVector of Snapshots. This function modifies the underlying simulation model and does not return a Snapshot. Thresholds are read from sim(s).options.
Nosy.extract — Function
extract(s::Snapshot)Return a Snapshot populated with values corresponding to the optimised system.
Nosy.conflicts — Function
conflicts(s::Sim)
conflicts(snapshot::Snapshot)Return the vector of constraints in conflict (IIS) of the simulation. If there are no conflicts, return nothing.
Carriers And Modifiers
Nosy.EnergyCarrier — Type
EnergyCarrier(name::String, sim::Sim; energy=nothing)Return an EnergyCarrier with name name associated with sim. Optional arguments:
energy: number, or vector with one value per hour or step, describing the energy density in MWh/t.
Nosy.MassCarrier — Type
MassCarrier(name::String, sim::Sim; energy=nothing)Return a MassCarrier with name name associated with sim. Optional arguments:
energy: number, or vector with one value per hour or step, describing the energy density in MWh/t.
Nosy.CO2Carrier — Type
CO2Carrier(name::String, sim::Sim; weight::Number=1.)Return a CO2Carrier with name name associated with sim. Optional arguments:
weight: CO2-equivalent weight in t CO2eq/t.
Nosy.PowerCarrier — Type
PowerCarrier(name::String, sim::Sim)Return a PowerCarrier with name name associated with sim.
Nosy.energy — Function
energy(x)Return the energy view of a carrier or port.
energy is a carrier modifier commonly passed to functions such as balance, capacity behaviors, and cost behaviors.
Nosy.mass — Function
mass(x)Return the mass view of a carrier or port.
mass is a carrier modifier commonly used with MassCarrier and CO2Carrier flows.
Nodes, Components, And Connections
Nosy.Node — Type
Node(name::String, c::AbstractCarrier; mesh=sim(c).mesh, losses::Number=0., rule::Symbol=:default, evalprice::Bool=false, tags::Vector{Symbol}=Symbol[])Construct a Node with name name associated with carrier c. A node has a unique carrier. The mesh argument defines the time mesh on which the node balance is applied. Connected component ports must use the same or a finer mesh than the node. The rule defines the node behavior (:default or :curtailed). The losses value is the ratio, between 0 and 1, of input flow that is lost. Set evalprice=true to store node-balance constraints for dual-price extraction. The tags argument initialises the node tags.
Nosy.Component — Type
Component(name::String, model::AbstractModelData, behaviors::AbstractVector; tags::Vector{Symbol}=Symbol[])Construct a Component with name name, model archetype model, behaviors and joint flows from behaviors, and optional tags.
Nosy.connect! — Function
connect!(s::Snapshot, c::Component, n::Node, pname::String)Connect port named pname of component c to node n on snapshot s.
connect!(s::Snapshot, c::Component, n::Node)Connect all compatible ports of component c to node n on snapshot s.
Nosy.hastag — Function
hastag(element, tag::Symbol)Return whether a component or node has tag.
Nosy.getnodes — Function
getnodes(snapshot; with=Symbol[], without=Symbol[])Return the nodes in snapshot, optionally filtered by tags.
Nosy.getcomponents — Function
getcomponents(snapshot; with=Symbol[], without=Symbol[])Return the components in snapshot, optionally filtered by tags.
getcomponents(s::Snapshot, nodename::String; with::Vector{Symbol}=Symbol[], without::Vector{Symbol}=Symbol[])Return components connected to the node named nodename in snapshot s. The with and without keywords filter connected components by tags.
Model Archetypes
Nosy.DispatchableSource — Type
DispatchableSource(carrier::AbstractCarrier)Return a DispatchableSource model archetype for carrier carrier.
Nosy.ProfileSource — Type
ProfileSource(carrier::AbstractCarrier, profile)Return a ProfileSource model archetype for carrier carrier with a non-negative profile profile.
If profile is a Number: the profile is flat. If profile is a Vector: it defines the profile.
The values of profile above cutoff will be set to cutoff.
Adding a capacity behavior is mandatory. The profile is not renormalised.
Nosy.Demand — Type
Demand(carrier::AbstractCarrier, series; modifier=defaultmodifier, mesh=sim(carrier).mesh)Return a Demand model archetype for carrier carrier with a non-negative series series. The parameter series can be either a Vector (of length equal to number of hours or steps) or a Number. If modifier is provided, series is interpreted in the modified carrier unit. The mesh argument defines the component mesh used by the demand port.
Nosy.BasicSink — Type
BasicSink(carrier::AbstractCarrier)Return a BasicSink model archetype for carrier carrier.
Nosy.ProfileSink — Type
ProfileSink(carrier::AbstractCarrier, profile; cutoff=Inf64)Return a ProfileSink model archetype for carrier carrier with a non-negative profile profile.
If profile is a Number, the profile is flat. If profile is a Vector, it defines the profile.
The values of profile above cutoff will be set to cutoff.
Adding a capacity behavior on input is mandatory. The profile is not renormalised.
Nosy.BasicConverter — Type
BasicConverter(input::AbstractCarrier, output::AbstractCarrier; ratio=1., modifier::Function=defaultmodifier, mesh=sim(input).mesh)Return a BasicConverter model archetype that converts carrier input into output with ratio ratio. The ratio can be a number or a time series. The mesh argument defines the component mesh used by both input and output ports.
Nosy.BasicStorage — Type
BasicStorage(carrier::AbstractCarrier; eff_i::Float64=1., eff_o::Float64=1., self_discharge::Float64=0., modifier=_defaultmodifier(carrierstyle(carrier)), simplified::Bool=false, mesh=sim(carrier).mesh)Return a BasicStorage model archetype using carrier for input, output, and level. The model uses input efficiency eff_i, output efficiency eff_o, and hourly self-discharge fraction self_discharge. A timestep of duration Δt retains (1 - self_discharge)^Δt of the initial level. The mesh argument defines the component mesh used by input, output, level, and the storage balance.
BasicStorage(input::AbstractCarrier, output::AbstractCarrier, level::AbstractCarrier, modifier::Function; eff_i::Float64=1., eff_o::Float64=1., self_discharge::Float64=0., simplified::Bool=false, mesh=sim(input).mesh)Return a BasicStorage model archetype associated with:
input: carrier of inputoutput: carrier of outputlevel: carrier of levelmodifier: modifier for all carrierseff_i: input efficiencyeff_o: output efficiencyself_discharge: fraction of stored energy lost per hour; a timestep of durationΔtretains(1 - self_discharge)^Δtsimplified: iftrue, use step flows instead of trapezoidal integrationmesh: component mesh used by input, output, level, and the storage balance
Storage is periodic: the step after the last step is the first step.
Nosy.LazyStorage — Type
LazyStorage(level::AbstractCarrier; modifier::Function=defaultmodifier, eff=nothing, self_discharge=0., simplified::Bool=false)Return a LazyStorage model archetype with a level of carrier level. The lazy storage constraint is applied to the level and associated joint flows after applying modifier to flows. self_discharge is the fraction of stored energy lost per hour. For a timestep of duration Δt, the fraction retained is (1 - self_discharge)^Δt. Storage is periodic: the step after the last step is the first step.
Nosy.ACLine — Type
ACLine(from::PowerCarrier, to::PowerCarrier, admittance::Number; mesh=sim(from).mesh)Return an ACLine model archetype from from to to, with admittance admittance. ACLine contributes to Kirchhoff Voltage Law (KVL).
Nosy.DCLine — Type
DCLine(from::PowerCarrier, to::PowerCarrier; mesh=sim(from).mesh)Return a DCLine model archetype from from to to. DCLine does not contribute to Kirchhoff Voltage Law (KVL).
Behaviors
Nosy.FixedCapacity — Type
FixedCapacity(pname::String, modifier::Function, val::Number; unitsize::Union{Nothing,Number})Return FixedCapacity behavior data associated with port name pname, modifier modifier, and fixed value val. If unitsize is a number, it is the size of one unit when considering a fleet.
Nosy.VariableCapacity — Type
VariableCapacity(pname::String, modifier::Function; lb::Number=0., ub::Number=Inf, warmstart::Union{Nothing,Number}=nothing, unitsize::Union{Nothing,Number}=nothing, integer::Bool=false, expression::Union{Nothing,GenericVariableRef,GenericAffExpr,Number}=nothing)Return VariableCapacity behavior data associated with port name pname and modifier modifier. Optional parameters:
lb: lower boundub: upper boundwarmstart: initial value for the capacity variableunitsize: size of one unit when considering a fleetinteger: ifunitsizeis a number, constrain the number of units to be integerexpression: reused capacity input (nothing,GenericVariableRef,GenericAffExpr, orNumber)
A numeric expression is interpreted as a fixed capacity by setting lb = ub = expression. warmstart is not supported when expression is provided. integer is supported only when expression is a GenericVariableRef.
Nosy.FixedComposedCapacity — Type
FixedComposedCapacity(pname::Union{String,Vector{String}}, modifier::Function, val::Number; unitsize::Union{Nothing,Number})Return FixedComposedCapacity behavior data associated with one or several port names pname, modifier modifier, and fixed value val. The capacity applies to the sum of targeted flows. If unitsize is a number, it is the size of one unit when considering a fleet.
Nosy.VariableComposedCapacity — Type
VariableComposedCapacity(pname::Union{String,Vector{String}}, modifier::Function; weights, lb::Number=0., ub::Number=Inf, warmstart::Union{Nothing,Number}=nothing, unitsize::Union{Nothing,Number}=nothing, integer::Bool=false)Return VariableComposedCapacity behavior data associated with one or several port names pname and modifier modifier. The capacity applies to the weighted sum of targeted flows. Optional parameters:
weights: relative weights of targeted flows, in the same order aspnamelb: lower boundub: upper boundwarmstart: initial value for the capacity variableunitsize: size of one unit when considering a fleetinteger: ifunitsizeis a number, constrain the number of units to be integer
Nosy.CapacityMultiplier — Type
CapacityMultiplier(pname::String, val)Return CapacityMultiplier behavior data associated with port name pname and a scalar or vector value val. The modifier is assumed to be the same as the capacity associated with port named pname.
Nosy.Duration — Type
Duration(hours::Number; inputpname::String="input", outputpname::String="output", levelpname::String="level")Return Duration behavior data linking storage flow capacity and level capacity by the duration hours. Exactly one of inputpname, outputpname, or levelpname must have a capacity behavior.
Nosy.YearlySum — Type
YearlySum(pname::String, val::Number, type::Symbol; modifier::Function=defaultmodifier)Return a YearlySum behavior, constraining the sum of the flow associated with port pname and modifier modifier over the year. If type is :equal, the sum is constrained to be equal to val. If type is :max, the sum is constrained to be less than or equal to val. If type is :min, the sum is constrained to be greater than or equal to val.
Nosy.Ramping — Type
Ramping(pname::String, sense::Symbol, val::Number; modifier::Function=defaultmodifier)Return a Ramping behavior that constrains the ramp rate of port pname. sense must be :up or :down, and val is the maximum rate in the modified carrier unit per hour.
Nosy.ReserveUp — Type
ReserveUp(name::String, pname::String, sense::Symbol, duration::Number; modifier::Function=defaultmodifier)Return ReserveUp behavior data.
name: groups reserves at snapshot level (e.g.,"FCR","15min").pname: port name the reserve applies to (e.g.,"output","input").sense::up(discharge increase) or:down(charge reduction); both provide upward reserve.duration: duration in hours, used for energy-limited constraints.modifier: must match the modifier used by capacity, ramping, and unit commitment behaviors for the target port.
Nosy.ReserveDown — Type
ReserveDown(name::String, pname::String, sense::Symbol, duration::Number; modifier::Function=defaultmodifier)Return ReserveDown behavior data.
name: groups reserves at snapshot level (e.g.,"FCR","15min").pname: port name the reserve applies to (e.g.,"output","input").sense::down(discharge reduction) or:up(charge increase); both provide downward reserve.duration: duration in hours, used for energy-limited constraints.modifier: must match the modifier used by capacity, ramping, and unit commitment behaviors for the target port.
Nosy.UnitCommitment — Type
UnitCommitment(pname::String, minratio::Number; startup::Number=0, shutdown::Number=0, uptime::Number=0, downtime=0, startupratio::Number=minratio, shutdownratio::Number=minratio, integer::Bool=false, startupmask::Union{Nothing,Vector{Bool}}=nothing, shutdownmask::Union{Nothing,Vector{Vector{Bool}}}=nothing)Return a UnitCommitment behavior related to port pname, with minimum flow ratio minratio. Optional parameters:
- startup: startup duration in hours (default=0).
- shutdown: shutdown duration in hours (default=0).
- uptime: minimum uptime duration in hours (default=0).
- downtime: minimum downtime duration in hours, or a vector of alternative downtime durations (default=0).
- startupratio: maximum flow ratio for a unit at the end of the startup phase (default=minratio)
- shutdownratio: maximum flow ratio for a unit at the beginning of the shutdown phase (default=minratio)
- integer: whether the unit commitment must follow an integer constraint (default=false).
- startupmask: Boolean vector disallowing startup at certain hours.
- shutdownmask: Vector of Boolean Vector, disallowing shutdown at certain hours for certain shutdown types.
Nosy.FixedCost — Type
FixedCost(type::Symbol, pname::String, modifier::Function, val::Number; threshold::Number=0.)Return FixedCost behavior data associated with cost type type, port name pname, modifier modifier, and fixed cost value val. When threshold is positive, the cost applies only to capacity above that threshold.
Nosy.ConstantCost — Type
ConstantCost(type::Symbol, val::Number)Return ConstantCost behavior data associated with cost type type and constant cost value val.
Nosy.VariableCost — Type
VariableCost(type::Symbol, pname::String, modifier::Function, val; style::Symbol=:step)Return VariableCost behavior data associated with cost type type, port name pname, modifier modifier, and cost val. val must be either a number or an AbstractVector{<:Number} with length equal to the number of steps or hours. If val is a vector, then style determines how it must be interpreted:
- if
style = :step, the cost is assumed to be a step function - if
style = :linear, the cost is assumed to vary linearly between timesteps
If val is a number, style has no effect.
Nosy.NoLoadCost — Type
NoLoadCost(type::Symbol, pname::String, val::Number)Return NoLoadCost behavior data associated with cost type type, port name pname, and hourly cost val.
Nosy.StartupCost — Type
StartupCost(type::Symbol, pname::String, val::Number)Return StartupCost behavior data associated with cost type type, port name pname, and per-startup cost val.
Joint Flows
Nosy.FixedJointFlow — Type
FixedJointFlow(name::String, carrier::AbstractCarrier, sense::Symbol, series; mustconnect::Bool=true)Return a FixedJointFlow with name name, sense sense, carrier carrier, and flow time series or scalar series. The series uses the carrier simulation mesh and is projected to the component mesh when the component is built.
Nosy.FreeJointFlow — Type
FreeJointFlow(name::String, carrier::AbstractCarrier, sense::Symbol; mustconnect::Bool=true)Return a FreeJointFlow with name name, sense sense, and carrier carrier.
Nosy.LinkedJointFlow — Type
LinkedJointFlow(name::String, carrier::AbstractCarrier, sense::Symbol, baseflows, f::Function; modifier::Function=defaultmodifier, mustconnect::Bool=true)Return a LinkedJointFlow with the following characteristics:
sense: sense of the joint flowbaseflows: name or names of the target component flows used to evaluate the joint flow. Must be a string or an iterable of strings.f: affine function that calculates the joint flow frombaseflows, e.g.x -> x[1] + 2 * x[2].modifier: modifier applied beforefto both flows
Balance
Nosy.balance — Function
balance(n::Node, sense::Symbol, modifier::Function; collapse::Bool=true, aggregate::Bool=true)Return the flow balance for node n.
Parameters:
n: Nodesense::inputor:outputmodifier: modifier function e.g.energy,mass,co2collapse: iftrue, the flows are summed over time; otherwise theHourlyseries are returnedaggregate: iftrue, the flows from multiple components are summed together, otherwise one entry per component is returned
balance(c::Component, sense::Symbol, modifier::Function; collapse::Bool=true, aggregate::Bool=true)Return the flow balance for component c.
Parameters:
c: Componentsense::input,:output, or:levelmodifier: modifier function e.g.energy,mass,co2collapse: iftrue, the flows are summed over time; otherwise theHourlyseries are returned. Must befalsewhensenseis:level.aggregate: iftrue, the multiple flows are summed together, otherwise one entry per flow is returned
balance(s::Snapshot, name::String, sense::Symbol, modifier::Function; collapse::Bool=false, aggregate::Bool=false)Return the flow balance for component or node name in snapshot s with sense sense and modifier modifier.
Optional arguments:
collapse: iftrue, the flows are summed over time; otherwiseHourlytime series are returnedaggregate: iftrue, the multiple flows are summed together, otherwise one entry per flow is returned
Metrics And Post-Processing
Nosy.capacity — Function
capacity(c::Component; multiplier::Bool=false)Return the capacity of a Component c. If multiplier is true, return the capacity multiplied with the matching capacity multiplier (same port) if it exists. If the component has no capacity, return zero.
capacity(c::Component, pname::String; multiplier::Bool=false)Return the capacity associated with port named pname of component c. If multiplier is true, return the capacity multiplied with the matching capacity multiplier (same port) if it exists. If the component has no port named pname, throw an error. If the component has no capacity associated with port pname, return Inf64.
capacity(s::Snapshot, cname::String; multiplier::Bool=false)Return the capacity of component with name cname from snapshot s. If multiplier is true, return the capacity multiplied with the matching capacity multiplier (same port) if it exists. If the component has no capacity, return zero. Throw an error if there is no component with name cname in s.
Nosy.nbunits — Function
nbunits(c::Component)
Return the number of units of Component c, related to its capacity and unit size. If c has no capacity or no unit size, return nothing.
Nosy.cost — Function
cost(c::Component)Return the cost of Component c.
cost(c::Component, type::Symbol)Return the cost of type type of Component c.
cost(s::Snapshot, cname::String)Return the cost of Component with name cname in Snapshot s. If the component has no cost, return zero. Throw an error if there is no component with name cname in s.
cost(s::Snapshot, cname::String, type::Symbol)Return the cost of type type of Component with name cname in Snapshot s. If the component has no cost, return zero. Throw an error if there is no component with name cname in s.
cost(s::Snapshot)Return the sum of the costs of the components of the Snapshot.
cost(s::Snapshot, type::Symbol)Return the sum of the costs of type type of the components of the Snapshot.
Nosy.fixedcost — Function
fixedcost(c::Component)Return the fixed cost of Component c. If the component has no fixed cost, return zero.
fixedcost(c::Component, type::Symbol)Return the fixed cost of type type of Component c. If the component has no fixed cost, return zero.
fixedcost(s::Snapshot, cname::String)Return the fixed cost of Component with name cname in Snapshot s. If the component has no fixed cost, return zero. Throw an error if there is no component with name cname in s.
fixedcost(s::Snapshot, cname::String, type::Symbol)Return the fixed cost of type type of Component with name cname in Snapshot s. If the component has no fixed cost of type type, return zero. Throw an error if there is no component with name cname in s.
fixedcost(s::Snapshot)Return the sum of fixed cost items of the components of s.
fixedcost(s::Snapshot, type::Symbol)Return the sum of fixed cost items of type type of the components of s.
Nosy.constantcost — Function
constantcost(c::Component)Return the constant cost of Component c. If the component has no constant cost, return zero.
constantcost(c::Component, type::Symbol)Return the constant cost of type type of Component c. If the component has no constant cost, return zero.
constantcost(s::Snapshot, cname::String)Return the constant cost of Component with name cname in Snapshot s. If the component has no constant cost, return zero. Throw an error if there is no component with name cname in s.
constantcost(s::Snapshot, cname::String, type::Symbol)Return the constant cost of type type of Component with name cname in Snapshot s. If the component has no constant cost of type type, return zero. Throw an error if there is no component with name cname in s.
constantcost(s::Snapshot)Return the sum of constant cost items of the components of s.
constantcost(s::Snapshot, type::Symbol)Return the sum of constant cost items of type type of the components of s.
Nosy.variablecost — Function
variablecost(c::Component)Return the variable cost of Component c. If the component has no variable cost, return zero.
variablecost(c::Component, type::Symbol)Return the variable cost of type type of Component c. If the component has no variable cost, return zero.
variablecost(s::Snapshot, cname::String)Return the variable cost of Component with name cname in Snapshot s. If the component has no variable cost, return zero. Throw an error if there is no component with name cname in s.
variablecost(s::Snapshot, cname::String, type::Symbol)Return the variable cost of type type of Component with name cname in Snapshot s. If the component has no variable cost of type type, return zero. Throw an error if there is no component with name cname in s.
variablecost(s::Snapshot)Return the sum of variable cost items of the components of s.
variablecost(s::Snapshot, type::Symbol)Return the sum of variable cost items of type type of the components of s.
Nosy.noloadcost — Function
noloadcost(c::Component)Return the no-load cost of Component c. If the component has no no-load cost, return zero.
noloadcost(c::Component, type::Symbol)Return the no-load cost of type type of Component c. If the component has no no-load cost, return zero.
noloadcost(s::Snapshot, cname::String)Return the no-load cost of Component with name cname in Snapshot s. If the component has no no-load cost, return zero. Throw an error if there is no component with name cname in s.
noloadcost(s::Snapshot, cname::String, type::Symbol)Return the no-load cost of type type of Component with name cname in Snapshot s. If the component has no no-load cost of type type, return zero. Throw an error if there is no component with name cname in s.
noloadcost(s::Snapshot)Return the sum of no-load cost items of the components of s.
noloadcost(s::Snapshot, type::Symbol)Return the sum of no-load cost items of type type of the components of s.
Nosy.startupcost — Function
startupcost(c::Component)Return the startup cost of Component c. If the component has no startup cost, return zero.
startupcost(c::Component, type::Symbol)Return the startup cost of type type of Component c. If the component has no startup cost, return zero.
startupcost(s::Snapshot, cname::String)Return the startup cost of Component with name cname in Snapshot s. If the component has no startup cost, return zero. Throw an error if there is no component with name cname in s.
startupcost(s::Snapshot, cname::String, type::Symbol)Return the startup cost of type type of Component with name cname in Snapshot s. If the component has no startup cost of type type, return zero. Throw an error if there is no component with name cname in s.
startupcost(s::Snapshot)Return the sum of startup cost items of the components of s.
startupcost(s::Snapshot, type::Symbol)Return the sum of startup cost items of type type of the components of s.
Nosy.reserve — Function
reserve(c::Component, sense::Symbol, rname::String)Return the reserve of Component c for the specified sense and rname. sense is :up for upward reserve or :down for downward reserve.
reserve(snap::Snapshot{T}, sense::Symbol, rname::String; with::Vector{Symbol}=Symbol[], without::Vector{Symbol}=Symbol[]) where TReturn the total reserve of components in Snapshot snap for the specified sense and reserve name rname. Optional with and without filter components by tags (same as getcomponents(snap; with, without)).
reserve(snap::Snapshot{T}, name::String, sense::Symbol, rname::String; with::Vector{Symbol}=Symbol[], without::Vector{Symbol}=Symbol[]) where TReturn the reserve of the component named name, or the total reserve of components connected to node named name, within Snapshot snap for the specified sense and reserve name rname. When name is a node, optional with and without filter components by tags.
Nosy.costs — Function
costs(s::Snapshot; removezero::Bool=false, addtotal::Bool=true)Return a DataFrame containing the details of all the cost items of all the components of Snapshot s. If removezero, components with costs equal to zero will not appear. If addtotal, sums over components and cost types will also be provided.
Nosy.table — Function
table(s::Snapshot, metric::Function; removenothing::Bool=true)Return a table containing the evaluation of the metric metric over the components of Snapshot s. If removenothing is true, the values equal to nothing will be discarded.
table(c::Component, modifier::Function; collapse::Bool=false)Perform a balance at all the ports of the component, following a given modifier. If collapse is true, return an OrderedDict of portname => yearly balance. If collapse is false, return a DataFrame of Hourly time series per port.
Nosy.dualprice — Function
dualprice(n::Node)Return the dual price associated with node n.
Export and Import Snapshots
Nosy.sanitize — Function
sanitize(snapshot)Return a lightweight copy of an extracted Snapshot{Float64}.
The sanitized snapshot has no JuMP model, keeps only portable option values, and replaces captured implementation functions with a Nosy-owned placeholder. This function does not serialize the snapshot. The original snapshot is restored before this function returns.
Nosy.exportsnapshot — Function
exportsnapshot(path, snapshot)
exportsnapshot(io, snapshot)Serialize an extracted Snapshot{Float64} after removing its JuMP model.
Path exports require a .snap extension. If no extension is provided, .snap is appended.
The original snapshot keeps its model after export. Imported snapshots are meant for reporting and post-processing, not for further optimization.
Nosy.importsnapshot — Function
importsnapshot(path)
importsnapshot(io)Deserialize a lightweight Snapshot{Float64} exported with exportsnapshot.