Agent Based algorithm for the study of molecular self-organisation