Modelling dynamic group behaviours