Change the number of particles in the PF dynamically

I am trying to create a particle filter method where the number of particles is adaptive, meaning it changes dynamically depending on whether the method is converging or not. I want to take inspiration from the repository GitHub - JuliaPOMDP/ParticleFilters.jl: Simple particle filter implementation in Julia - works with POMDPs.jl models or others., but I don’t quite understand how it works or where the particles used by the BasicParticleFilter are set. I understand that it is initialized when the BasicParticleFilter is declared, but I don’t fully understand where it is stored afterwards or when it is used. For example, what is the purpose of _particle_memory and _weight_memory? Which attribute of which method should I change for the update method to automatically adjust the number of particles it generates?