SpECTRE  v2024.04.12
control_system::UpdateAggregator Struct Reference

A class for collecting and storing information related to updating functions of time and measurement timescales. More...

#include <UpdateFunctionOfTime.hpp>

Public Member Functions

 UpdateAggregator (std::string combined_name, std::unordered_set< std::string > active_control_system_names)
 Construct a new UpdateAggregator using a set of active control system names and the combined name for the measurement. More...
 
void insert (const std::string &control_system_name, const DataVector &new_measurement_timescale, double new_measurement_expiration_time, DataVector control_signal, double new_fot_expiration_time)
 Inserts and stores information for one of the control systems that this class was constructed with. More...
 
bool is_ready () const
 Checks if insert has been called for all control systems that this class was constructed with.
 
const std::stringcombined_name () const
 Returns a sorted concatenation of the control system names this class was constructed with.
 
std::unordered_map< std::string, std::pair< DataVector, double > > combined_fot_expiration_times () const
 Once is_ready is true, returns a map between the control system name and a std::pair containing the control_signal that was passed to insert and the minimum of all the new_fot_expiration_times passed to insert. More...
 
std::pair< double, double > combined_measurement_expiration_time ()
 Once is_ready is true, returns a std::pair containing the minimum of all new_measurement_timescales passed to insert and the minimum of all new_measurement_expiration_times passed to insert. More...
 

Detailed Description

A class for collecting and storing information related to updating functions of time and measurement timescales.

Details

This class also determines if enough data has been received in order for the functions of time and measurement timescales to be updated. There should be one UpdateAggregator for every group of control systems that have the same control_system::protocols::Measurement.

Constructor & Destructor Documentation

◆ UpdateAggregator()

control_system::UpdateAggregator::UpdateAggregator ( std::string  combined_name,
std::unordered_set< std::string active_control_system_names 
)

Construct a new UpdateAggregator using a set of active control system names and the combined name for the measurement.

It is expected that all the control systems in this set use the same control_system::protocols::Measurement.

Member Function Documentation

◆ combined_fot_expiration_times()

std::unordered_map< std::string, std::pair< DataVector, double > > control_system::UpdateAggregator::combined_fot_expiration_times ( ) const

Once is_ready is true, returns a map between the control system name and a std::pair containing the control_signal that was passed to insert and the minimum of all the new_fot_expiration_times passed to insert.

Details

This function is expected to only be called when is_ready is true. It also must be called before combined_measurement_expiration_time.

◆ combined_measurement_expiration_time()

std::pair< double, double > control_system::UpdateAggregator::combined_measurement_expiration_time ( )

Once is_ready is true, returns a std::pair containing the minimum of all new_measurement_timescales passed to insert and the minimum of all new_measurement_expiration_times passed to insert.

Details

This function is expected to be called only when is_ready is true and only a single time once all control active control systems for this measurement have computed their update values. It also must be called after combined_fot_expiration_times. This function clears all stored data when it is called.

◆ insert()

void control_system::UpdateAggregator::insert ( const std::string control_system_name,
const DataVector new_measurement_timescale,
double  new_measurement_expiration_time,
DataVector  control_signal,
double  new_fot_expiration_time 
)

Inserts and stores information for one of the control systems that this class was constructed with.

Parameters
control_system_nameName of control system to add information for
new_measurement_timescaleDataVector of new measurement timescales calculated from a control system update.
new_measurement_expiration_timeNew measurement expiration time calculated during that update.
control_signalNew highest derivative for the function of time calculated during that update (will be std::moveed).
new_fot_expiration_timeNew function of time expiration time calculated for during that update

The documentation for this struct was generated from the following file: