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

PhET-iO instrumentation of sampling models #241

Closed
pixelzoom opened this issue May 14, 2024 · 5 comments
Closed

PhET-iO instrumentation of sampling models #241

pixelzoom opened this issue May 14, 2024 · 5 comments

Comments

@pixelzoom
Copy link
Contributor

Related to #231 (PhET-iO instrumentation for particles) and #236 (PhET-iO support for data fluency) ...

The following things sample the particle system:

  • AverageSpeedModel - the Average Speed accordion box in the Energy screen, an average of samples collected during a fixed period of time
  • HistogramModel - the Speed and KE histograms in the Energy screen, an average of samples collected during a fixed time period
  • ParticleFlowRateModel - the flow rate arrows shown in the Diffusion screen, a running average of a constant number of samples

For each of these, the samples need to be stateful. For the elements that involve a fixed time period, the accumulated time must also be stateful.

@pixelzoom pixelzoom self-assigned this May 14, 2024
pixelzoom added a commit that referenced this issue May 14, 2024
@pixelzoom
Copy link
Contributor Author

Most of this work was done as part of #30, #77, and #231. In the above commits, documentation for IOTypes was improved.

@pixelzoom
Copy link
Contributor Author

@arouinfar @Nancy-Salpepi @kathy-phet This is ready for review. Below is a summary of the relevant PhET-iO elements.

Average Speed

heavyAverageSpeedProperty and lightAverageSpeedProperty are the (running) average speeds for heavy and light particles respectively, as displayed in the Average Speed accordion box. These Properties are phetioFeatured: true.

averageSpeedModel handles serialization of internal elements that are used to derive the above Properties. All of its fields are for internal use only, so it is phetioFeatured: false. AverageSpeedModelIO is its IOType, which looks like this in Studio:
screenshot_3300

Speed and KE histograms

heavyKineticEnergyBinCountsProperty, lightKineticEnergyBinCountsProperty, and totalKineticEnergyBinCountsProperty are the bin counts displayed by the Kinetic Energy histogram. These Propertes are phetioFeatured: true.

heavySpeedBinCountsProperty, lightSpeedBinCountsProperty, and totalSpeedBinCountsProperty are the bin counts displayed by the Speed histogram. These Propertes are phetioFeatured: true.

histogramsModel handles serialization of internal elements that are used to derive the above Properties. All of its fields are for internal use only, so it is phetioFeatured: false. HistogramsModelIO is its IOType, which looks like this in Studio:
screenshot_3301

Particle Flow Rate

particle1FlowRateModel.leftFlowRateProperty and particle1FlowRateModel.rightFlowRateProperty are the left and right flow rates displayed for particles of type 1. These Propertes are phetioFeatured: true.

particle2FlowRateModel.leftFlowRateProperty and particle2FlowRateModel.rightFlowRateProperty are the left and right flow rates displayed for particles of type 2. These Propertes are phetioFeatured: true.

particle1FlowRateModel and particle2FlowRateModel handle serialization of internal elements that are used to derive the above Properties. All of their fields are for internal use only, so they are phetioFeatured: false. ParticleFlowRateModelIO is their IOType, which looks like this in Studio:
screenshot_3302

@pixelzoom
Copy link
Contributor Author

In #235, serialization of the histograms was optimized. HistogramsModelIO now look like this. Rather than storing raw samples of speed and KE, the samples are immediately processed into "cumulative bins", then averaged later. This greatly reduces the amount of serialized data.

screenshot_3314

@pixelzoom
Copy link
Contributor Author

@arouinfar and @Nancy-Salpepi noted a potential problem with restoring state for the Speed histogram, tracking in #261.

@arouinfar @Nancy-Salpepi if everything else looks OK here, and the state schemas look reasonable, please close this issue.

@arouinfar
Copy link
Contributor

@arouinfar @Nancy-Salpepi if everything else looks OK here, and the state schemas look reasonable, please close this issue.

Looks good, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants