A computational frame to study social behaviour in animals