def act(environment)
    excess = environment.object_count - @count
    if excess > 0
      objects_for_removal = []
      environment.objects.each do |object|
        objects_for_removal << object
        break if objects_for_removal.length >= excess
      end
      objects_for_removal.each {|object| environment.remove_object(object.identifier)}
    end
  end
def act(environment)
    excess = environment.object_count - @count
    if excess > 0
      objects_for_removal = []
      environment.objects.each do |object|
        objects_for_removal << object
        break if objects_for_removal.length >= excess
      end
      objects_for_removal.each {|object| environment.remove_object(object.identifier)}
    end
  end
Remove objects if there are too many objects in environment.