quanser / Quanser_Interactive_Labs_Resources

Libraries, documentation and tutorials for coding using the Quanser Interactive Labs environment.
0 stars 1 forks source link

How to remove an actor by specific actor number? #3

Closed hunterls97 closed 7 months ago

hunterls97 commented 7 months ago

I noticed in the QuanserInteractiveLabs class we have the following function to delete all actors: https://github.com/quanser/Quanser_Interactive_Labs_Resources/blob/b63f2184e693da7aab99379e9fb487ebb542fa2e/python/qvl/qlabs.py#L395

But is there a way to delete actors by passing a specific actor number? I believe this is possible since the static variable defined here implies this functionality exists, but I am not sure what the format of the payload would need to be for the container if I want to call the send_container function directly. Could an example be provided?

drwidgit commented 7 months ago

Hi @hunterls97 , yes you can destroy individual actors, or all actors of a given class. Most of the actors are derived from the base actor.py class so they all have the methods "destroy" and "destroy_all_actors_of_class". You can refer to our online documentation for something a bit more human-readable (https://qlabs.quanserdocs.com/en/latest/Objects/index.html).

hunterls97 commented 7 months ago

I hadn't noticed the destroy methods in the actor class, these worked well. Thanks!