phetsims / shred

A library of JavaScript code that is used in PhET simulations that depict atoms, subatomic particles, and atomic structure. This was originally created to contain the code that is shared between the "Build an Atom" and "Isotopes and Atomic Mass" simulations, thought it may be applied to additional simulations in the future.
GNU General Public License v3.0
1 stars 6 forks source link

AtomIdentifier: how to handle two of the same decay? #42

Open pixelzoom opened 1 year ago

pixelzoom commented 1 year ago

In AtomIdentifier.ts, there are a number of TODOs that look like this:

    28: {
      '2B-': 75,
      // '2B-': 69, // TODO: how to handle two of the same decay? https://github.com/phetsims/tasks/issues/1129
      'B-': 25
    },

It looks like these TODOs were added by @Luisav1 on 3/22/22, and the commit message indicates that it's related to https://github.com/phetsims/build-a-nucleus/issues/8. Can you please add some information here about what the problem is, where you encountered it, etc?

Luisav1 commented 1 year ago

All unstable nuclides and their decays are stored in the object DECAYS_INFO_TABLE. Both the decay type (ex. B-, 2B-, etc.) and the percentage likelihood that a nuclide will undergo that specific decay is stored in this table.

However, the issue is that for some nuclides there are two entries for the same decay, with (usually) different percentages, which results in DECAYS_INFO_TABLE having multiple properties with the same name. This is not allowed since DECAYS_INFO_TABLE is an object literal so there should be no duplicate keys.

The problematic nuclides and their duplicated decays are:

Possible solutions:

zepumph commented 1 year ago

We are not covering this for BAN 1.1 release, deferred.