Position-based dynamic of a particle system: a configurable algorithm to describe complex behaviour of continuum material starting from swarm robotics