Harmony
HARMONic stabilitY assessment of PE-penetrated power systems
Loading...
Searching...
No Matches
SubNetwork.h
Go to the documentation of this file.
1
6#ifndef SUBNETWORK_H
7#define SUBNETWORK_H
8
9#include "network.h"
10
20class SubNetwork : public Network {
21private:
22 std::unordered_map<std::string, Bus*> outputBuses; // Output buses specific to this subnetwork
23 std::string subnetworkName;
24 bool transformation = true;
25
26public:
30 SubNetwork();
31
36 explicit SubNetwork(const std::string& name);
37
45
50 std::string getSubNetworkName() const { return subnetworkName; }
51
56 void setSubNetworkName(const std::string& name) { subnetworkName = name; }
57
63 void addOutput(const std::string& busName, Bus* bus) {
64 if (bus) {
65 outputBuses[busName] = bus;
66 }
67 }
68
73 void setTransformation(bool flag) { transformation = flag; }
74
79 bool getTransformation() const { return transformation; }
80
85 const std::unordered_map<std::string, Bus*>& getOutputs() const { return outputBuses; }
86
91 const int getNumberOfOutputs() const { return outputBuses.size(); }
92
97 const string getName() const { return subnetworkName; }
98
102 void printInfo() const;
103};
104
105#endif // SUBNETWORK_H
A network node connecting one or more element terminals.
Definition Bus.h:21
Root network model holding buses, elements, and AC/DC grid hierarchy.
Definition network.h:36
Named sub-network that inherits Network topology APIs but acts as a non-owning view.
Definition SubNetwork.h:20
bool getTransformation() const
Query whether coordinate transformation is enabled.
Definition SubNetwork.h:79
const string getName() const
Get the sub-network name (alias for getSubNetworkName).
Definition SubNetwork.h:97
const int getNumberOfOutputs() const
Get the number of registered output buses.
Definition SubNetwork.h:91
void addOutput(const std::string &busName, Bus *bus)
Register an output (interface) bus for this sub-network.
Definition SubNetwork.h:63
void printInfo() const
Print sub-network summary (name, bus/element counts, output bus count).
Definition SubNetwork.cpp:29
std::string getSubNetworkName() const
Get the sub-network name.
Definition SubNetwork.h:50
~SubNetwork()
Release sub-network maps without deleting buses or elements.
Definition SubNetwork.cpp:16
void setTransformation(bool flag)
Enable or disable coordinate transformation (e.g.
Definition SubNetwork.h:73
void setSubNetworkName(const std::string &name)
Set the sub-network name.
Definition SubNetwork.h:56
SubNetwork()
Construct an unnamed sub-network with default name "Unnamed_SubNetwork".
Definition SubNetwork.cpp:7
const std::unordered_map< std::string, Bus * > & getOutputs() const
Const access to the output-bus map.
Definition SubNetwork.h:85
Top-level electrical network container: buses, elements, connections, and hierarchical grids.