Лабораторная работа: Imitating modelling of a cattle-breeding complex on basis Cedar Bog
AND (NUMBER(Bulls) < 3) DO
Calves^: TO Bulls SEND Animal[Index]
CHANGING
Age^:= Calves:Animal[Index].Age;
Weight^:= Calves:Animal[Index].Weight;
END
END
IF (Calves:Animal[Index].Age > (500 + Norm_raspr(10,2)))
AND (Calves:Animal[Index].Weight > 1000) DO
VesTyw^:= VesTyw + Calves:Animal[Index].Weight/2;
Calves^: REMOVE Animal[Index];
UBOI^:= UBOI + 1;
END
END
WHENEVER (Stage = 4) AND (Index > NUMBER(Calves)) DO
Stage^:=5;
Index^:=1;
END
# Bulls are slaughtered
WHENEVER (Stage = 5) AND (Index <= NUMBER(Bulls)) DO
Index^:= Index + 1;
Bulls:Animal[Index].Age^:= Bulls:Animal[Index].Age + 1;
Dung^:= Dung + 20;
IF Bulls:Animal[Index].Weight < 1000 DO
Bulls:Animal[Index].Weight^:= Bulls:Animal[Index].Weight + ves_3;
END
IF Bulls:Animal[Index].Age > 3000 DO
VesTyw^:= VesTyw + Bulls:Animal[Index].Weight/2;
Bulls^: REMOVE Animal[Index];