* Returns the total information bits required to represent this particle and all its subparticles. * This is calculated as the sum of: * 1. Information bits of all atoms in this particle * 2. Information bits of all subparticles (recursive)
()
| 18179 | * 2. Information bits of all subparticles (recursive) |
| 18180 | */ |
| 18181 | get bitsRequired() { |
| 18182 | // Get information bits for all atoms in this particle |
| 18183 | const atomBits = this.parsedAtoms.map(atom => atom.bitsRequired).reduce((sum, bits) => sum + bits, 0) |
| 18184 | // Recursively get information bits from all subparticles |
| 18185 | const subparticleBits = this.map(child => child.bitsRequired).reduce((sum, bits) => sum + bits, 0) |
| 18186 | return atomBits + subparticleBits |
| 18187 | } |
| 18188 | getSubparticleInstancesOfParserId(parserId) { |
| 18189 | return this.particleIndex[parserId] || [] |
| 18190 | } |