Foxes and Rabbit
Class yang digunakan : 1. Rabbit import java.util.List; import java.util.Random; public class Rabbit { // Characteristics shared by all rabbits (static fields). // The age at which a rabbit can start to breed. private static final int BREEDING_AGE = 5; // The age to which a rabbit can live. private static final int MAX_AGE = 40; // The likelihood of a rabbit breeding. private static final double BREEDING_PROBABILITY = 0.15; // The maximum number of births. private static final int MAX_LITTER_SIZE = 4; // A shared random number generator to control breeding. private static final Random rand = Randomizer.getRandom(); // Individual characteristics (instance fields). // The rabbit's age. private int age; // Whether the rabbit is alive or not. private boolean alive; // The rabbit's position. private Location location; // The field occupied. ...