The distribution of kicks per screen and per kicker (Variability screen) can be preset before or after soccer balls have
been kicked using the kickDistributionStrategy
.
centerAndVariability.medianScreen.model.sceneModel.kickDistributionStrategy
centerAndVariability.meanAndMedianScreen.model.sceneModel.kickDistributionStrategy
centerAndVariability.variabilityScreen.model.sceneKicker1Model.kickDistributionStrategy
centerAndVariability.variabilityScreen.model.sceneKicker2Model.kickDistributionStrategy
centerAndVariability.variabilityScreen.model.sceneKicker3Model.kickDistributionStrategy
centerAndVariability.variabilityScreen.model.sceneKicker4Model.kickDistributionStrategy
To test a kickDistributionStrategy
, navigate to the data entry text box and enter the
desired kickDistributionStrategy
, then press Set Value
.
Below are four customizations for setting a specific kickDistributionStrategy
.
Set the distribution by giving frequencies or relative frequencies for each of the 15 locations on the number line. If frequencies are entered, the model calculates probabilities (i.e. relative frequencies) automatically. Using this type of distribution strategy allows for a semi-unpredictable distribution where the likelihood of a ball landing in each position is known, but the exact kick distances are unknown.
To test this strategy, navigate to the data entry text box in the Element Panel, enter the value such as the one below,
and then press Set Value
.
{
"type": "probabilityByDistance",
"values": [0,0,1,3,5,7,3,3,1,1,0,0,0,0,1],
"skewType": null
}
Set the distribution of exact kick distances in the order given in the array. The size of the array is determined by the maximum number of kicks as set in Preferences.
To test this kickDistributionStrategy
, navigate to the data entry text box in the Element Panel, enter a value such as
the one below, and then press Set Value
. The example below tells the model to kick the first ball 5 meters, the second
ball 11 meters, and so on.
{
"type": "distanceByIndex",
"values": [5,11,9,12,10,2,7,3,4,14,1,15,8,13,2,4,12,10,6,1,13,9,3,14,5,6,11,8,7,15],
"skewType": null
}
Note: If there are already soccer balls in the play area, the next kick will land in its corresponding array position.
For example, if four balls have been kicked into positions 5, 11, 9, and 12 meters, and then the
kickDistributionStrategy
is set to the above value, the next kick will travel 10 meters (the 5th ball will land at the
5th value in the array).
Set the model to randomly choose between a left and a right skewed distribution with equal probability. The array to set
a skewed distribution uses the Probability by Distance kickDistributionStrategy
described
above.
To test this kickDistributionStrategy
, navigate to the data entry text box in the Element Panel, enter the value
below, and then press Set Value
. The given example will first create a left skewed kick distribution. The next time a
distribution is created (e.g., upon reset), the kick distribution will randomly have a left or right skew.
{
"type": "randomSkew",
"values": null,
"skewType": "left"
}
Note: The default array used to provide the left-skewed distribution is: [4,4,4,4,4,4,4,5,10,12,18,30,45,25,10]. The right skewed array is reversed.
Choose a left or right skewed distribution. Once chosen, the distribution of kicks will continue to have this skew until changed.
To test this kickDistributionStrategy
, navigate to the data entry text box in the Element Panel, enter the value below
to set the distribution to always be left skewed, and then press Set Value
. Replace “left” with “right” to set the
distribution to always be right skewed.
{
"type": "skew",
"values": null,
"skewType": "left"
}
A command can be used in the API to get the array of soccer ball positions or values of cards in the order they appear.
await phetioClient.invokeAsync( 'centerAndVariability.medianScreen.model', 'getDataPoints', [] );
await phetioClient.invokeAsync( 'centerAndVariability.meanAndMedianScreen.model', 'getDataPoints', [] );
await phetioClient.invokeAsync( 'centerAndVariability.variabilityScreen.model', 'getDataPoints', [] );
await phetioClient.invokeAsync( 'centerAndVariability.medianScreen.model.distanceAccordionBox.cardContainerModel', 'getData' )
The statistical data related to any distribution is collected under the sceneModel
.
The mean and median are the only statistical data provided on these screens.
centerAndVariability.medianScreen.model.sceneModel.meanValueProperty
centerAndVariability.medianScreen.model.sceneModel.medianValueProperty
centerAndVariability.meanAndMedianScreen.model.sceneModel.meanValueProperty
centerAndVariability.meanAndMedianScreen.model.sceneModel.medianValueProperty
The Variability screen contains a separate scene for each kicker, e.g. sceneKicker1Model
, which contains a larger
variety of statistical data including range, IQR, and MAD.
centerAndVariability.variabilityScreen.model.sceneKicker1Model.meanValueProperty
centerAndVariability.variabilityScreen.model.sceneKicker1Model.medianValueProperty
centerAndVariability.variabilityScreen.model.sceneKicker1Model.minValueProperty
centerAndVariability.variabilityScreen.model.sceneKicker1Model.maxValueProperty
centerAndVariability.variabilityScreen.model.sceneKicker1Model.rangeValueProperty
centerAndVariability.variabilityScreen.model.sceneKicker1Model.iqrValueProperty
centerAndVariability.variabilityScreen.model.sceneKicker1Model.madValueProperty
centerAndVariability.variabilityScreen.model.sceneKicker1Model.q1ValueProperty
centerAndVariability.variabilityScreen.model.sceneKicker1Model.q3ValueProperty
For brevity, the measures of center and spread on the Variability screen are shown above for kicker 1 only.
The phetioID
s for each kicker can be found in the variabilityScreen.model
:
centerAndVariability.variabilityScreen.model.sceneKicker1Model
centerAndVariability.variabilityScreen.model.sceneKicker2Model
centerAndVariability.variabilityScreen.model.sceneKicker3Model
centerAndVariability.variabilityScreen.model.sceneKicker4Model
In addition to finding statistical data in the PhET-iO Studio tree on the Variability screen, the data for the currently
selected scene can be extracted using the API. The example below demonstrates how to get the mean value for the current
scene, but the command can be adapted for any of the properties listed above. Note: this is only relevant to the
Variability screen. Data for the Median and Mean & Median screens should be obtained using the phetioID
s listed above.
let mean = await phetioClient.invokeAsync( 'centerAndVariability.variabilityScreen.model.selectedSceneModelProperty', 'getValue' )
.then( async sceneElement => phetioClient.invokeAsync( sceneElement.phetioID + '.meanValueProperty', 'getValue' ) );
Each soccer ball on the field can be individually enabled/disabled before or after it has been kicked. Each soccer
ball’s phetioID
follows the pattern below, replacing variabilityScreen.view.sceneKicker1View
with the desired screen and scene,
and soccerBallNode1
with the corresponding ball number.
centerAndVariability.variabilityScreen.view.sceneKicker1View.soccerBallNodes.soccerBallNode1.enabledProperty
In general, all soccer balls can be found nested under the phetioID
s listed below.
centerAndVariability.medianScreen.view.sceneView1.soccerBallNodes
centerAndVariability.meanAndMedianScreen.view.sceneView1.soccerBallNodes
centerAndVariability.variabilityScreen.view.sceneKicker1View.soccerBallNodes
centerAndVariability.variabilityScreen.view.sceneKicker2View.soccerBallNodes
centerAndVariability.variabilityScreen.view.sceneKicker3View.soccerBallNodes
centerAndVariability.variabilityScreen.view.sceneKicker4View.soccerBallNodes
Note: Since each ball has a unique phetioID
, the ball number needs to be known so the correct ball is
enabled/disabled. If there is a stack of balls at a single location, only the top ball in a stack is auto-selectable,
meaning only the top ball’s
phetioID
is known. It is recommended to disable soccer balls as they are kicked if it is desired to have specific
soccer balls disabled and others enabled.
The entire group of soccer balls can be enabled/disabled rather than one ball at a time. If the group is disabled, any remaining soccer balls not yet kicked will be disabled upon kicking.
centerAndVariability.medianScreen.model.soccerArea.soccerBallsEnabledProperty
centerAndVariability.meanAndMedianScreen.model.soccerArea.soccerBallsEnabledProperty
centerAndVariability.variabilityScreen.model.soccerArea.soccerBallsEnabledProperty
Note: Disabling the group of soccer balls on the Variability screen will disable the group for all kickers. It is not possible to disable Kicker 1’s group but not Kicker 2’s group, for example.
The cards on the Median screen can be manually or auto-sorted. The API can listen for an emitter that fires when the cards have been manually sorted. For example, the command below will print “hello” upon a successful manual sort:
phetioClient.invoke( 'centerAndVariability.medianScreen.model.distanceAccordionBox.cardContainerModel.manuallySortedEmitter', 'addListener', [ () => console.log( 'hello' ) ] )
Note: The emitter fires every time the cards have been sorted manually. The Sort Data checkbox auto-sorts the cards, and when any card is moved away and back to its position, the emitter will fire. It is recommended to hide the checkbox or the checkbox group to encourage genuine manual sorting.
centerAndVariability.medianScreen.view.distanceAccordionBox.checkboxGroup.visibleProperty
centerAndVariability.medianScreen.view.distanceAccordionBox.checkboxGroup.sortDataCheckbox.visibleProperty
Note: The areCardsSortedProperty
becomes true
regardless of whether the cards were sorted via the checkbox or
manually, so to listen for the manual sort, be sure to use the command above rather than the phetioID
shown below:
centerAndVariability.medianScreen.model.distanceAccordionBox.areCardsSortedProperty
The entire distribution of points (x’s or dots, according to the Preferences) can be hidden in the Accordion Box on the Mean & Median or Variability screens.
centerAndVariability.meanAndMedianScreen.model.plotAccordionBox.isDataPointLayerVisibleProperty
centerAndVariability.variabilityScreen.model.variabilityMeasureAccordionBox.isDataPointLayerVisibleProperty
The question at the top of each screen can be customized, or the entire bar can be hidden. When the question bar is hidden, the entire accordion box shifts up to the top of the screen.
Customize the question with:
centerAndVariability.general.model.strings.centerAndVariability.medianQuestionStringProperty
centerAndVariability.general.model.strings.centerAndVariability.meanAndMedianQuestionStringProperty
centerAndVariability.general.model.strings.centerAndVariability.variabilityQuestionStringProperty
Hide the question bar with:
centerAndVariability.medianScreen.view.questionBar.visibleProperty
centerAndVariability.meanAndMedianScreen.view.questionBar.visibleProperty
centerAndVariability.variabilityScreen.view.questionBar.visibleProperty
As noted in PhET-iO guide, most strings are auto-selectable by pressing shift+alt
(PC)
or shift+option
(Mac) and mousing over the text. Strings involving mathematical expressions or calculations, however,
are not auto-selectable, such as the mean and median.
All strings in the simulation can be found under general.model.strings
and are sorted alphabetically. For example, if
you prefer to use the term “average” instead of “mean”, look for instances of “mean” under
centerAndVariability.general.model.strings.centerAndVariability
and update the strings accordingly. Double check your
strings, keeping in mind some of the strings only appear when checkboxes are active, or when dialogs are open.
There are two cueing hands in the sim that indicate objects are moveable: one on the Median screen only that appears on the cards in the Accordion box, and one on each screen in the soccer ball area.
On the Median screen, the cueing hand on the cards appears upon the second kick and disappears once any card has been moved. If it is desired to create a specific order of the cards prior to launching the sim, it is not possible to move the cards to the desired order as the cueing hand will disappear. We offer two suggestions to force the cue to remain on the cards upon launch:
distanceByIndex
and create a
distribution of kicks with the cards in the desired orderThe cueing hand that indicated soccer balls are moveable on all screens appears upon the last kick and not before (per Max Kicks value set in Preferences). Like the cueing hand on the cards described above, this cueing hand's visibility nor location is customizable. The hand will appear on the last ball kicked, unless the ball is in the median stack, in which case the hand will move to a new stack. If a specific distribution is desired, we recommend the following:
distanceByIndex
and create a
distribution of kicks with the cards in the desired orderThe position of the Predict Median, Predict Mean, and Pointer tools can be customized by direct interaction with the simulation in PhET-iO Studio or by using the properties listed below. The positions of these tools will be retained when the checkbox is toggled off and on.
Preset the location of the prediction pointer tools with:
centerAndVariability.medianScreen.model.soccerArea.predictMedianValueProperty
centerAndVariability.meanAndMedianScreen.model.soccerArea.predictMedianValueProperty
centerAndVariability.meanAndMedianScreen.model.soccerArea.predictMeanValueProperty
centerAndVariability.variabilityScreen.model.soccerArea.pointer.pointerValueProperty
Set the visibility of the prediction pointer tools with:
centerAndVariability.medianScreen.model.soccerArea.isPredictMedianVisibleProperty
centerAndVariability.meanAndMedianScreen.model.soccerArea.isPredictMedianVisibleProperty
centerAndVariability.meanAndMedianScreen.model.soccerArea.isPredictMeanVisibleProperty
centerAndVariability.variabilityScreen.model.soccerArea.pointer.isPointerVisibleProperty
The interval tool has two handles that move independently to create a custom width, and the entire interval tool block can be translated left and right without changing its width. Customize the location of each handle to set the width of the interval tool by direct interaction with the simulation in PhET-iO Studio or by using the properties listed below. Each handle can be made visible/invisible without impacting the translatability of the tool.
Set the value of each handle with:
centerAndVariability.variabilityScreen.model.intervalToolModel.handle1ValueProperty
centerAndVariability.variabilityScreen.model.intervalToolModel.handle2ValueProperty
Hide the handles to fix the width of the interval. The interval tool block can still be translated left and right.
centerAndVariability.variabilityScreen.view.intervalToolNode.handle1.visibleProperty
centerAndVariability.variabilityScreen.view.intervalToolNode.handle2.visibleProperty
Prevent the entire tool from being translatable while still allowing each handle to be interactive:
centerAndVariability.variabilityScreen.model.intervalToolModel.isTranslationEnabledProperty
There are four preferences in the Preferences dialog, located under centerAndVariability.global.model.preferences
.
This is a global setting and indicates the maximum number of kicks for all screens.
centerAndVariability.global.model.preferences.maxKicksProperty
Since Reset All does not change any preferences, it is recommended to hide the Max Kicks option in the preferences menu when setting the maximum number of kicks via the PhET-iO Standard Wrapper.
centerAndVariability.general.view.navigationBar.preferencesButton.preferencesDialogCapsule.preferencesDialog.preferencesPanels.simulationPreferencesPanel.simPreferences.maxKicksControl.visibleProperty
Note: Due to the limited space in the accordion box, the maximum number of kicks on the Median screen is 15, regardless of whether the maximum number kicks is set higher than 15 in the Preferences.
This setting changes the markers on screens 2 and 3 to be either x’s or dots.
centerAndVariability.global.model.preferences.plotTypeProperty
On the Variability screen, outliers can be shown when the boxplot radio button is chosen. Using the standard calculation, any values less than Q1 – 1.5(IQR) or greater than Q3 + 1.5(IQR) are considered outliers and are indicated by a diamond. The default setting is to not show outliers (i.e. include outliers in the whiskers)
centerAndVariability.global.model.preferences.showOutliersProperty
The preferences listed above can also be hidden using the phetioID
s below. Note that the preferences dialog must first
be opened.
centerAndVariability.general.view.navigationBar.preferencesButton.preferencesDialogCapsule.preferencesDialog.preferencesPanels.simulationPreferencesPanel.simPreferences.maxKicksControl.visibleProperty
centerAndVariability.general.view.navigationBar.preferencesButton.preferencesDialogCapsule.preferencesDialog.preferencesPanels.simulationPreferencesPanel.simPreferences.outliersControl.visibleProperty
centerAndVariability.general.view.navigationBar.preferencesButton.preferencesDialogCapsule.preferencesDialog.preferencesPanels.simulationPreferencesPanel.simPreferences.plotTypeControl.visibleProperty
Additionally, the Plot Type radio button can be visible but disabled:
centerAndVariability.general.view.navigationBar.preferencesButton.preferencesDialogCapsule.preferencesDialog.preferencesPanels.simulationPreferencesPanel.simPreferences.plotTypeControl.radioButtonGroup.enabledProperty