A simulation model of the dynamics of aquatic macroinvertebrate communities