Skip to content

How do I receive entities from a simulator in mosaik? #7

Answered by Ma1t3
Ma1t3 asked this question in Q&A
Discussion options

You must be logged in to vote

In principle, there is actually no designated method for accessing the simulator-internal entities in the scenario script. How they are stored exactly can vary from simulator to simulator. Plus, if the simulator is not written in Python and does not run in the same process as mosaik, there is no way to do this.
So the world.sims[...].proxy.sim method you proposed is about as hacky as it feels.

The "right" solution would be to extend the simulator whose internal entities you would like to have with a corresponding extra_method that returns these entities or the information required from them. More information about extra_methods and how to use them can be found here: simulator-docs
Unfortu…

Replies: 1 comment

Comment options

Ma1t3
Jan 16, 2024
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by Ma1t3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant