Template Class VariableMonitorController

Nested Relationships

Nested Types

Inheritance Relationships

Base Type

Class Documentation

template<typename scalar_type>
class VariableMonitorController : public GridKit::Model::VariableMonitorBase

Monitor associated with the SystemModel; controls output from component and bus monitors.

High-level print functions (without parameters) manage printing for all monitors for multiple output sinks.

Unnamed Group

using Format = VariableMonitorFormat

Alias.

Public Types

using ScalarT = scalar_type

Underlying scalar value type.

using RealT = typename GridKit::ScalarTraits<ScalarT>::RealT

Underlying real value type.

Public Functions

VariableMonitorController() = default

Default to empty monitor.

inline explicit VariableMonitorController(const RealT &time_var)

Constructor expects a time variable to monitor.

inline void addMonitor(const VariableMonitorBase *monitor)

Add a monitor to the output.

Each component and bus could have a monitor for their respective values.

Parameters:

monitor – Monitor to add (raw pointer indicates ownership is elsewhere)

inline void addSink(const SinkSpec &spec, std::ostream &os = std::cout)

Add output sink based on spec.

If spec.file_name is empty, std::cout is used.

Parameters:

spec – Specifies details for the sink.

inline void addVariable(const std::string &label, const RealT *value)

Provide additional top-level variables (alongside time) to be printed before submonitors.

Parameters:
  • label – Header label for CSV; key for JSON or YAML

  • value – Pointer to monitored variable

inline virtual bool empty() const override

Is there nothing to monitor?

inline void start()

Print header if we’re monitoring.

inline void stop()

Print footer if we’re monitoring.

template<typename FormatT>
inline void printFullHeader(std::ostream &os, FormatT fmt) const

Organize header output for this and all submonitors.

inline void printHeader() const

Print header for all sinks.

template<typename FormatT>
inline void printFull(std::ostream &os, FormatT fmt) const

Organize variable output for this and all submonitors.

inline void print() const

Print variables to each sink.

template<typename FormatT>
inline void printFullFooter(std::ostream &os, FormatT fmt) const

Organize footer output for this and all submonitors.

inline void printFooter() const

Print footer for all sinks.