A method for controlling the milking by a milking machine comprises the
steps of: (i) providing (41) different milking schemes, each of which
being distinguished by a set of milking parameters, such as milking
vacuum, high pulse vacuum, low pulse vacuum, pulse rate, and pulse
length; (ii) controlling (43) the milking machine for the milking of a
milking animal so that each of the different milking schemes is applied
for at least one milking of the milking animal; (iii) for each of the
milkings, recording (45) milk yield and/or milking time of the milking of
the animal; (iv) evaluating (51) each of the milking schemes for milking
the animal based on the recorded milk yield and/or milking time; and (v)
selecting (53) one of the milking schemes based on the evaluation, and
controlling (53) the milking machine during subsequent milkings of the
animal so that they are performed according to the selected milking
scheme.