A thermodynamical model of cell distributions in the slug of cellular slime mold