One could easily derive Alternative for Population. It would have the effect of concatenating several particle populations.
For example, (spawn 100 >> model1) <|> (spawn 100 >> model2) would have 200 particles, where 100 have been conditioned according to the first model, and the others according to the second model.
Another useful function might be take :: Int -> Population -> Population which makes sure at most a certain number of particles are in the filter. Probably, the ones with the lowest mass should be dropped.
One could easily derive
Alternative
forPopulation
. It would have the effect of concatenating several particle populations.For example,
(spawn 100 >> model1) <|> (spawn 100 >> model2)
would have 200 particles, where 100 have been conditioned according to the first model, and the others according to the second model.Another useful function might be
take :: Int -> Population -> Population
which makes sure at most a certain number of particles are in the filter. Probably, the ones with the lowest mass should be dropped.