Evolution of cannibalism in an age-structured population