-
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
DecayModel.halfLifeNumberProperty doesn't support "unknown" half lives #111
Comments
It isn't clear what the desired behavior is for the halfLifeNumberProperty when it reaches unknown. @Luisav1 let me know if you want assistance on this. |
If the half-life is null (aka "unknown") then the half-life is set to -1 when the build-a-nucleus/js/decay/model/DecayModel.ts Lines 51 to 54 in f2b033a
Then this is dealt with appropiatly in the listener: build-a-nucleus/js/decay/view/HalfLifeNumberLineNode.ts Lines 268 to 276 in 74f8279
The use of -1 as a placeholder can be done in // Get the half-life of a nuclide with the specified number of protons and neutrons.
getNuclideHalfLife: function( numProtons: number, numNeutrons: number ): number | null | undefined {
if ( !HalfLifeConstants[ numProtons ] ) {
return undefined;
}
else if ( HalfLifeConstants[ numProtons ][ numNeutrons ] === null ) {
return -1;
}
return HalfLifeConstants[ numProtons ][ numNeutrons ];
}, |
I think the issue to solve here is that the terms Also if you would like my response or assistance on an issue please re-assign me so I don't lose it (which I am very good at doing). |
…urns only number or null. Add doc. See #111.
…urns only number or null. Add doc. See phetsims/build-a-nucleus#111.
Discussed with @Luisav1, let's also change null -> -1 in HalfLifeConstants too.
|
After finding this data |
Found while handling a TODO in #93. If unknown, then that Property should be
null
(from AtomIdentifier), but that isn't supported or expected from its TypeScript implementation.The text was updated successfully, but these errors were encountered: