How to limit the number of particles on the polymerization chain?

I want to simulate the phenomenon that particles in space form bonds to form polymer chains. So how to limit the number of particles on a chain? When there is a particle bond break at one end of the polymer chain, how to add a particle at the other end?

you cannot limit the chain length directly. that would be unphysical, as during polymerization there is no knowledge of the length of chains, just the probability to form a bond based in vicinity of suitable neighboring atoms and likeliness to create a bond. both can be controlled by parameters to fix bond create. you would also want to set a limit as to how many bonds an atom of a given type may form (and then have the fix change the type for you).