To capture the event-queue simulation recipe, you define step
, a
RabbitApplication
instance method.
Because the Rabbit
instance that has the earliest delivery month is
always at the front of the rabbits
collection, step
can obtain
that Rabbit
instance by sending the removeFirst
message,
which both removes the Rabbit
instance from the collection and makes
the Rabbit
instance available for assignment to the mother
instance variable:
RabbitApplication method definition instance step | mother daughter | mother := rabbits removeFirst. ...