Harmony
HARMONic stabilitY assessment of PE-penetrated power systems
Loading...
Searching...
No Matches
SimulationBuilder Class Reference

Orchestrates JSON validation, network assembly, and post-build computations. More...

#include <simulation_builder.h>

Public Member Functions

 SimulationBuilder ()=default
 
 ~SimulationBuilder ()=default
 
void buildFromJSON (const JSON &simJSON, Network &network)
 Populate network from a full simulation JSON document.
 
void runComputations (const JSON &simJSON, Network &network, bool plottingEnabled=true) const
 Run analyses selected in the simulation JSON (OPF, stability, etc.).
 
int runComputationsWithStatus (const JSON &simJSON, Network &network, bool plottingEnabled=true) const
 
const JSONgetSimulationConfig () const
 Return the parsed simulation configuration object.
 
void validateJSON (const JSON &simJSON) const
 Validate required top-level JSON sections and unique IDs.
 

Detailed Description

Orchestrates JSON validation, network assembly, and post-build computations.

Constructor & Destructor Documentation

◆ SimulationBuilder()

SimulationBuilder::SimulationBuilder ( )
default

◆ ~SimulationBuilder()

SimulationBuilder::~SimulationBuilder ( )
default

Member Function Documentation

◆ buildFromJSON()

void SimulationBuilder::buildFromJSON ( const JSON simJSON,
Network network 
)

Populate network from a full simulation JSON document.

Parameters
simJSONRoot JSON object (simulation, buses, components, …).
networkTarget network to populate.

References Network::addElement(), ComponentBuilder::buildFromJSON(), JsonParameterTable::mergeFromObject(), and JsonValidator::validateRoot().

Referenced by runJsonSimulation().

◆ getSimulationConfig()

const JSON & SimulationBuilder::getSimulationConfig ( ) const
inline

Return the parsed simulation configuration object.

◆ runComputations()

void SimulationBuilder::runComputations ( const JSON simJSON,
Network network,
bool  plottingEnabled = true 
) const

Run analyses selected in the simulation JSON (OPF, stability, etc.).

Parameters
simJSONRoot JSON object (must contain a simulation section).
networkAssembled network to analyse.
plottingEnabledWhen false, JSON plot / plot_result flags are ignored (CLI --no-plot).

References runComputationsWithStatus().

◆ runComputationsWithStatus()

int SimulationBuilder::runComputationsWithStatus ( const JSON simJSON,
Network network,
bool  plottingEnabled = true 
) const
Returns
Number of failed computation steps (0 if none or no computations section).

References ComputationRunner::runAll().

Referenced by runComputations(), and runJsonSimulation().

◆ validateJSON()

void SimulationBuilder::validateJSON ( const JSON simJSON) const

Validate required top-level JSON sections and unique IDs.

Parameters
simJSONRoot JSON object.

References j, and JsonValidator::validateRoot().


The documentation for this class was generated from the following files: