Network
Quick Links
MultiStateSystems.Network
MultiStateSystems.add_component!
MultiStateSystems.add_components!
MultiStateSystems.add_source!
MultiStateSystems.add_sources!
MultiStateSystems.add_user!
MultiStateSystems.add_users!
Introduction
In its essence, a network (abbr: ntw) is a collection of sources, components and users mapped onto a directed multigraph.
Any network has eight attributes:
- a multigraph
ntw.graph::DiMultigraph
- network properties
ntw.props::PropDict
- components
ntw.cmp::Vector{PropDict}
- sources
ntw.src::Vector{PropDict}
- users
ntw.usr::Vector{PropDict}
- component library
ntw.clib::LibDict
- source library
ntw.slib::LibDict
- users library
ntw.ulib::LibDict
Constructors
One constructor is implemented:
MultiStateSystems.Network
— MethodNetwork()
An network constructor.
Example
julia> ntw = Network()
Info
A number of properties are defined for networks captured by NetworkInfo
.
solved
: the solved property describes whether the ugf of a network's users have been determined.dependent_source
: the dependent source property flags that the output of all sources in the network are dependent on an uniform source, e.g., wind turbines in a single windfarm.
Component
Any component (abbr: cmp) is represented by a PropDict
mapped onto either the vertices or edges of the multigraph ntw.graph
. The collection of all components is stored in ntw.cmp
, which is a vector.
The link between the component id, i.e., its index in ntw.cmp
, and the vertex/edge of ntw.graph
to which it is mapped is stored in ntw.clib
(key: vertex/edge, value: [cmp...]).
Any property may be added to the Propdict
representing the component, however certain properties are reserved for specific functionality of the tool, each linked to a specific key [Symbol].
:node
is reserved for the component's node in the multigraphntw.graph
:edge
is reserved for the component's edge in the multigraphntw.graph
:std
is reserved for the state-transition diagram of the component
In order to link the specific component to either a vertex or an edge of the network, it is obligatory to provide them through the named argument :node
or :edge
, respectively.
Components may either be added to a network individually or grouped using, respectively:
MultiStateSystems.add_component!
— Methodadd_components!(ntw::MultiStateSystems.AbstractNetwork; kwargs...)
Adds a single component to the network ntw
and fills their corresponding PropDict
with the named arguments kwargs
.
Example
julia> ntwᵖʷʳ = ntw()
julia> add_components!(ntwᵖʷʳ, edge = (1,2),
name = "cable 1",
std = STD(power = [0u"MW",1500u"MW"],
prob = [0.2,0.8]))
MultiStateSystems.add_components!
— Methodadd_components!(ntw::MultiStateSystems.AbstractNetwork; kwargs...)
Adds multiple components to the network ntw
and fills their corresponding PropDict
with the named arguments kwargs
. Either an uniform arguments is given which holds for all components or an array is given whith specific argument for each component.
Example
julia> ntwᵖʷʳ = ntw()
julia> add_components!(ntwᵖʷʳ, edge = [(1,2),(1,2),(2,3)],
name = ["cable 1","cable 2","cable 3"],
std = [STD(power = [0u"MW",1500u"MW"],
prob = [0.2,0.8]),
STD(power = [0u"MW",2000u"MW"],
prob = [0.4,0.6]),
STD(power = [0u"MW",1800u"MW",4000u"MW"],
prob = [0.1,0.2,0.7])])
Source
Any source (abbr: src) is represented by a PropDict
mapped onto either the vertices of the multigraph ntw.graph
. The collection of all sources is stored in ntw.src
, which is a vector.
The link between the source id, i.e., its index in ntw.src
, and the vertex of ntw.graph
to which it is mapped is stored in ntw.slib
(key: vertex, value: [cmp...]).
Any property may be added to the Propdict
representing the source, however certain properties are reserved for specific functionality of the tool, each linked to a specific key [Symbol].
:node
is reserved for the source's node in the multigraphntw.graph
:std
is reserved for the state-transition diagram of the source:ntw
is reserved for the tuple (ntw,usr) representing the source, where usr is the user-id [Int] of the network ntw.:dep_source
is reserved for thedependent_source
property.:dep_eval
is reserved for thedependent_evaluation
property.
In order to link the specific source to a vertex of the network, it is obligatory to provide them through the named argument :node
.
Sources may either be added to a network individually or grouped using, respectively:
MultiStateSystems.add_source!
— Methodadd_source!(ntw::MultiStateSystems.AbstractNetwork; kwargs...)
Adds a single source to the network ntw
and fills their corresponding PropDict
with the named arguments kwargs
.
Example
julia> ntwᵖʷʳ = ntw()
julia> stdᵍᵉⁿ = solvedSTD(prob = [0.1,0.2,0.7],
flow = [0.0u"MW",0.5u"MW",2.0u"MW"])
julia> add_source!(ntwᵖʷʳ, node = 1,
name = "generator 1",
std = stdᵍᵉⁿ)
MultiStateSystems.add_sources!
— Methodadd_sources!(ntw::MultiStateSystems.AbstractNetwork; kwargs...)
Adds multiple sources to the network ntw
and fills their corresponding PropDict
with the named arguments kwargs
. Either an uniform arguments is given which holds for all components or an array is given whith specific argument for each component.
Example
julia> ntwᵖʷʳ = ntw()
julia> stdᵍᵉⁿ = solvedSTD(prob = [0.1,0.2,0.7],
flow = [0.0u"MW",0.5u"MW",2.0u"MW"])
julia> add_sources!(ntwᵖʷʳ, node = 1:5,
std = stdᵍᵉⁿ,
dep = true)
Users
Any user (abbr: usr) is represented by a PropDict
mapped onto either the vertices of the multigraph ntw.graph
. The collection of all users is stored in ntw.usr
, which is a vector.
The link between the user id, i.e., its index in ntw.usr
, and the vertex of ntw.graph
to which it is mapped is stored in ntw.ulib
(key: vertex, value: [cmp...]).
Any property may be added to the Propdict
representing the user, however certain properties are reserved for specific functionality of the tool, each linked to a specific key [Symbol].
:node
is reserved for the user's vertex in the multigraphntw.graph
:std
is reserved for the state-transition diagram of the user:ind
is reserved for the user's indices
In order to link the specific user to a vertex of the network, it is obligatory to provide them through the named argument :node
.
Users may either be added to a network individually or grouped using, respectively:
MultiStateSystems.add_user!
— Methodadd_user!(ntw::MultiStateSystems.AbstractNetwork; kwargs...)
Adds a single user to the network ntw
and fills their corresponding PropDict
with the named arguments kwargs
.
Example
julia> ntwᵖʷʳ = ntw()
julia> add_source!(ntwᵖʷʳ, node = 1,
ind = [:EENS])
MultiStateSystems.add_users!
— Methodadd_users!(ntw::MultiStateSystems.AbstractNetwork; kwargs...)
Adds multiple users to the network ntw
and fills their corresponding PropDict
with the named arguments kwargs
. Either an uniform arguments is given which holds for all components or an array is given whith specific argument for each component.
Example
julia> ntwᵖʷʳ = ntw()
julia> add_sources!(ntwᵖʷʳ, node = [1,5,8],
ind = [:EENS])