Social niche specialization under constraints: personality, social interactions and environmental heterogeneity