A method of automatically milking animals, such as cows, which are allowed
to move freely in an area (1) intended therefore and to visit
individually a milking parlor (9) comprising a fully automatic milking
machine or milking robot (14) and an animal identification system (20),
comprises the steps of dynamically assigning a milking qualification
parameter to each of the animals that are allowed to move freely in said
area, the respective milking qualification parameter indicating the
degree of suitability that the respective animal, to which the milking
qualification parameter is assigned, shall be milked; dynamically ranking
the animals in accordance with their respective milking qualification
parameters; and milking an animal during a visit to the milking parlor
only if said animal is identified as belonging to the X highest ranked
animals, i.e. the X animals that are best suited to be milked from a milk
production optimization viewpoint, X being a positive integer.