-
Notifications
You must be signed in to change notification settings - Fork 5
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
PhET-iO instrumentation #216
Comments
Whoops! |
@chrisklus is going to implement with basic tandems and then request a design meeting (current target sept 12 design meeting) |
@ariel-phet when I said two weeks during our discussion I was intending for 09/05/19 design meeting, if that's a possibility. A dev test has been opened, so if nothing crazy comes from that then I'll be able to do initial tandem passing before Thursday next week. |
Before instrumenting
Code ReviewA high-quality code review will make instrumentation easier, promote long term maintainability for the simulation, and protect the simulation from a volatile API. If the simulation is already in good shape, the review will not take too long. If the simulation is not in good shape, then it needs your help.
InstrumentationNow that the simulation is in good shape and the PhET-iO design meeting is complete, we are ready to instrument the simulation. Follow the checklist below, and if you have questions you can review Faraday's Law or Graphing Quadratics and their PhET-iO instrumentations, or reach out to teammates who may have come this way before. Initial Setup
Visit Objects that Should be InstrumentedConsult the PhET-iO design issue to see what features the sim should support. See
Creating and Naming TandemsWell-designed tandem names are important. Once the PhET-iO simulation is published, the API becomes public and therefore difficult to change. Sometimes PhET-iO design meetings can also help come up tandem names. NOTE: "Tandem" is a PhET internal name, publicly to clients the full strings are known as "phetioIDs" referring to PhET-iO elements.
Feature Support
Create new TypeIOsIf necessary, create new TypeIOs to support desired feature set. Generally we don't want to be locked in to coupling
See phetsims/beers-law-lab#213 for more context on prior problems in this area and discussion Also note that the since work completed in https://github.com/phetsims/phet-io/issues/1398, PhET-iO interframe The Data Stream
Support dynamic stateFor simulations that have static content (such as a fixed number of objects and properties), instrumentation Details about how to support dynamic state.Note: TANDEM/Group is under development in https://github.com/phetsims/phet-io/issues/1454 to make it easier to instrument Until that is complete, Beer's Law Lab and Charges and Fields demonstrates how this may be done. A container class defines two methods: When state is set, first the container is cleared, then children are created. Child states can be obtained from Dispose must be implemented properly on all dynamic instances, or else it will result in stale values in the playback sim. On January 11, 2017 ControlPoints were not being disposed correctly in Energy-skate-park-basics, causing a mysterious bug Other tips and tricks for "impossible set state":
Dispose functions must be added to types that are instrumented. But that's only half of the memory management issue. The Two types of serializationData type serialization For example, numbers, strings, Vector2 instances fall into this category. These values Reference type serialization For example, Nodes and Properties. For example, if a simulation has one Post Instrumentation and Checks
Tips, Tricks, Notes, Misc
Review and Publication
Maintaining
|
Basic tandem passing is complete on branch |
First dev version: https://phet-dev.colorado.edu/html/energy-forms-and-changes/1.2.0-phetioInstrumentation.1/phet-io/wrappers/studio/ Some things I've noticed to discuss for 09/12/19 design meeting: Intro Screen
Systems Screen
|
@zepumph suggested moving this customization as an optional menu dialog located in the sim along with a button to relaunch the sim once the customizations are applied. This would allow for the customization to be confined to one place, instead of every entry point for the sim. In Studio, we would need to find a way to relaunch Studio, not just the sim itself. This pattern would also make customizing for phet brand simpler, because the website's sim page wouldn't need to know about which query params are available for a given sim version. We'll bring this up in design meeting and discuss further. |
@zepumph what do you think about bypassing the normal sim construction and going straight to the query parameter UI via a query parameter, like: sim.html?configure . This would still version and deploy within the sim HTML. |
That sounds like it is worth investigation! In the sim feels like it is most robust, and will be easiest to maintain. I still reserve the right to be outvoted if people think that this belongs outside the sim. |
…mprovements to systems model, see #216
EFAC with phet-io was published in 1.4.0. I think a lot of things can probably be checked off in this issue now, and we should consider just closing it once it has been updated. |
Oops, I didn't mean to actually close it. It should probably be updated a bit before we do. |
We are planning on having a design meeting for PhET-iO instrumentation of this sim while it's still fresh for @jbphet and me.
The text was updated successfully, but these errors were encountered: