OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
openswmm::controls::ControlEngine Class Reference

#include <Controls.hpp>

Collaboration diagram for openswmm::controls::ControlEngine:

Classes

struct  PremiseSoA
 Pre-sorted premise index for batch evaluation. More...
 

Public Member Functions

void init (const std::vector< Rule > &rules)
 
int evaluate (SimulationContext &ctx, double current_time, double dt)
 Evaluate all control rules and set link target settings.
 
int parseRuleText (const std::string &text, SimulationContext &ctx)
 
void addNamedVariable (const std::string &name, ConditionVar var, int idx)
 
int addExpression (const std::string &name, const std::string &formula)
 
std::vector< Rule > & rules ()
 
void buildPremiseSoA ()
 Build SoA index from rules. Called once at init().
 
void batchEvaluateGroup (PremiseSoA &group, const SimulationContext &ctx, double current_time, double half_step)
 Batch evaluate all premises of one variable type.
 

Member Function Documentation

◆ addExpression()

int openswmm::controls::ControlEngine::addExpression ( const std::string &  name,
const std::string &  formula 
)
Here is the call graph for this function:

◆ addNamedVariable()

void openswmm::controls::ControlEngine::addNamedVariable ( const std::string &  name,
ConditionVar  var,
int  idx 
)

◆ batchEvaluateGroup()

void openswmm::controls::ControlEngine::batchEvaluateGroup ( PremiseSoA group,
const SimulationContext ctx,
double  current_time,
double  half_step 
)

Batch evaluate all premises of one variable type.

Here is the caller graph for this function:

◆ buildPremiseSoA()

void openswmm::controls::ControlEngine::buildPremiseSoA ( )

Build SoA index from rules. Called once at init().

Here is the caller graph for this function:

◆ evaluate()

int openswmm::controls::ControlEngine::evaluate ( SimulationContext ctx,
double  current_time,
double  dt 
)

Evaluate all control rules and set link target settings.

Implements:

  • Short-circuit AND evaluation
  • Time-aware EQ/NE comparison with half-step tolerance
  • Priority-based action deduplication per link
  • Curve/timeseries/PID modulated control
  • ControlValue tracking for modulated actions
Parameters
ctxSimulation context.
current_timeCurrent simulation time (seconds).
dtRouting timestep (seconds).
Returns
Number of setting changes made.
Here is the call graph for this function:

◆ init()

void openswmm::controls::ControlEngine::init ( const std::vector< Rule > &  rules)
Here is the call graph for this function:

◆ parseRuleText()

int openswmm::controls::ControlEngine::parseRuleText ( const std::string &  text,
SimulationContext ctx 
)
Here is the call graph for this function:

◆ rules()

std::vector< Rule > & openswmm::controls::ControlEngine::rules ( )
inline
Here is the caller graph for this function:

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