-
Notifications
You must be signed in to change notification settings - Fork 103
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
Adding objects that can replay completed scenarios #54
base: main
Are you sure you want to change the base?
Conversation
Note that the added test case is not final and will need adjustments to be pytest runnable. |
src/scenic/core/simulators.py
Outdated
""" | ||
return tuple(obj.position for obj in self.objects) | ||
return [self.getProperties(obj, obj.properties) for obj in self.objects] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want to call getProperties
again since it may be slow (e.g. actually talking to the simulator). I would just return {prop: getattr(obj, prop) for prop in obj._dynamicProperties}
. Also the docstring should clarify that it's only dynamic properties that are saved (you can link to the glossary by writing ":term:`dynamic properties`").
The PR is ready for review:
|
…Verify/Scenic into replay_simulations merging from cleanup fix
This is a working PR that is not to be immediately merged. Feedback will be gathered and used in future commits.
The intention of this PR is to add the capability to "reconstitute" completed Scenarios, and be able to replay through the completed scenarios in a pythonic object. Additionally, new behaviors can be added to a ReplaySimulation object, and compared against the actions taken in the completed simulation.
This PR does not yet support the transitioning from a ReplaySimulation object to a Simulation object, for the purposes of "picking up where you left off" and resuming an in-progress simulation.
Additional questions:
Added fixes and changes to come.
@dfremont @ek65 let me know your feedback. Thanks!