A monarchy is a form of government in which a group, generally a family representing a dynasty (aristocracy), embodies the country's national identity and its head, the monarch, exercises the role of sovereignty. The actual power of the monarch may vary from purely symbolic, to partial and restricted, to completely autocratic. Traditionally the monarch's post is inherited and lasts until death or abdication. In contrast, elective monarchies require the monarch to be elected. Both types have further variations as there are widely divergent structures and traditions defining monarchy. For example, in some elected monarchies only pedigrees are taken into account for eligibility of the next ruler, whereas many hereditary monarchies impose requirements regarding the religion, age, gender, mental capacity, etc. Occasionally this might create a situation of rival claimants whose legitimacy is subject to effective election. There have been cases where the term of a monarch's reign is either fixed in years or continues until certain goals are achieved: an invasion being repulsed, for instance.