-
Notifications
You must be signed in to change notification settings - Fork 3
/
types.jl
26 lines (19 loc) · 821 Bytes
/
types.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"""
InfrastructureGraph{T<:LightGraphs.AbstractGraph}
A structure containing a graph of a PowerModels or PowerModelsDistribution network in
the format of a LightGraphs.AbstractGraph and corresponding metadata necessary for
analysis / plotting.
"""
mutable struct InfrastructureGraph{T<:LightGraphs.AbstractGraph}
graph::LightGraphs.AbstractGraph
metadata::Dict{Union{Int,LightGraphs.AbstractEdge},Dict{Symbol,<:Any}}
end
"""
InfrastructureGraph(nvertices)
Constructor for the InfrastructureGraph struct, given a number of vertices `nvertices`
"""
function InfrastructureGraph(nvertices::Int)
graph = LightGraphs.SimpleDiGraph(nvertices)
metadata = Dict{Union{Int,LightGraphs.AbstractEdge},Dict{Symbol,<:Any}}()
return InfrastructureGraph{LightGraphs.SimpleDiGraph}(graph, metadata)
end