Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally selecting a subset of variables to observe in cosim::last_value_observer(provider) #686

Open
davidhjp01 opened this issue Mar 1, 2022 · 0 comments
Labels
discussion needed Let's have a discussion about this enhancement New feature or request

Comments

@davidhjp01
Copy link
Contributor

Currently cosim::last_value_observer caches all port values (variables) of the simulators in every simulation step. However, in many scenarios, this may be not necessary. For example, if a simulator uses the observer to display data for only a single FMU at any given time. To improve simulation performance, it would be better to give a master algorithm an ability to capture only a subset of a model's port values in each step.

In this regard, I suggest to add additional methods in cosim::last_value_provider (A parent of cosim::last_value_observer) and cosim::slave_value_provider to enable this 'optional' feature.

For example:

virtual void cosim::last_value_provider::select_variables(simulator_index sim, gsl::span<const value_reference> variables) = 0;

virtual void cosim::last_value_provider::unselect_variables(simulator_index sim, gsl::span<const value_reference> variables) = 0;

virtual void cosim::last_value_provider::clear_variables() = 0;
@davidhjp01 davidhjp01 added discussion needed Let's have a discussion about this enhancement New feature or request labels Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion needed Let's have a discussion about this enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant