source codes for measuring crowd collectiveness