SpECTRE
v2024.09.29
|
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::string & | combined_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_time s 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_timescale s passed to insert and the minimum of all new_measurement_expiration_time s passed to insert . More... | |
A class for collecting and storing information related to updating functions of time and measurement timescales.
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
.
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
.
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_time
s passed to insert
.
This function is expected to only be called when is_ready
is true. It also must be called before 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_timescale
s passed to insert
and the minimum of all new_measurement_expiration_time
s passed to insert
.
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.
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.
control_system_name | Name of control system to add information for |
new_measurement_timescale | DataVector of new measurement timescales calculated from a control system update. |
new_measurement_expiration_time | New measurement expiration time calculated during that update. |
control_signal | New highest derivative for the function of time calculated during that update (will be std::move ed). |
new_fot_expiration_time | New function of time expiration time calculated for during that update |