You can use group_of_animals_c::pre_randomize to create the array to the maximum possible size (12, given your constraint) and construct each element of the array. The array may shrink during randomization to satisfy other constraints. Something like this:
function void pre_randomize();
animal_da = new;
if(animal_da == null) animal_da=new();
Using array reduction is the right idea to constraint the sum of animal weights. You can use a "with" clause to sum the individual animal weights.