Selecting frequency and conditions for a caste to form