Harmony
HARMONic stabilitY assessment of PE-penetrated power systems
Loading...
Searching...
No Matches
simulation_builder.h
Go to the documentation of this file.
1#pragma once
2#include "component_builder.h"
3
12 double start = 1.0;
13 double end = 1000.0;
14 int points = 100;
15};
16
21
22public:
23
24 SimulationBuilder() = default;
25 ~SimulationBuilder() = default;
26
32 void buildFromJSON(const JSON& simJSON, Network& network);
33
40 void runComputations(const JSON& simJSON, Network& network, bool plottingEnabled = true) const;
41
43 int runComputationsWithStatus(const JSON& simJSON, Network& network, bool plottingEnabled = true) const;
44
46 const JSON& getSimulationConfig() const { return simulationConfig_; }
47
49 void validateJSON(const JSON& simJSON) const;
50
51private:
52
58 void buildBusesFromJSON(const JSON& simJSON, Network& network) const;
59
65 void connectElementsToBuses(const JSON& simJSON, Network& network) const;
66
68 static FrequencyRange parseFrequencyRange(const JSON& rangeJson);
69
76 static void connectComponent(const JSON& comp, Element* elem, Network& network);
77
78 JSON simulationConfig_;
79};
Base class for multi-phase network elements with Y-parameters and MNA stamping hooks.
Definition Element.h:29
Root network model holding buses, elements, and AC/DC grid hierarchy.
Definition network.h:36
Orchestrates JSON validation, network assembly, and post-build computations.
Definition simulation_builder.h:20
void runComputations(const JSON &simJSON, Network &network, bool plottingEnabled=true) const
Run analyses selected in the simulation JSON (OPF, stability, etc.).
Definition simulation_builder.cpp:138
SimulationBuilder()=default
const JSON & getSimulationConfig() const
Return the parsed simulation configuration object.
Definition simulation_builder.h:46
void buildFromJSON(const JSON &simJSON, Network &network)
Populate network from a full simulation JSON document.
Definition simulation_builder.cpp:16
int runComputationsWithStatus(const JSON &simJSON, Network &network, bool plottingEnabled=true) const
Definition simulation_builder.cpp:147
void validateJSON(const JSON &simJSON) const
Validate required top-level JSON sections and unique IDs.
Definition simulation_builder.cpp:50
~SimulationBuilder()=default
Factory for constructing Element objects from JSON component entries.
nlohmann::json JSON
Definition component_builder.h:6
Frequency sweep specification parsed from JSON.
Definition simulation_builder.h:11
double start
Start frequency (Hz).
Definition simulation_builder.h:12
int points
Number of logarithmic sweep points.
Definition simulation_builder.h:14
double end
End frequency (Hz).
Definition simulation_builder.h:13