@@ -0,0 +1,2462 @@
+// Bruce Maxwell%0A// CS 231 Fall 2012%0A// Project 7%0A// *Utilizes Bruce Maxwell's Landscape class from the Elevator Simulation project.%0A%0Aimport java.util.*;%0A%0Apublic class Landscape %7B%0A    private double width;%0A    private double height;%0A    private LinkedList%3CCell%3E agents;%0A%0A    // Constructor%0A    public Landscape(double rows, double cols) %7B%0A        this.agents = new LinkedList%3C%3E();%0A        this.height = rows;%0A        this.width = cols;%0A    %7D%0A%0A    // get rid of all of the agents%0A    public void reset() %7B%0A        agents.clear();%0A    %7D%0A%0A    // modify to round%0A    public int getRows() %7B%0A        return (int)(height + 0.5);%0A    %7D%0A%0A    // add method%0A    public double getHeight() %7B%0A        return height;%0A    %7D%0A%0A    // modify to round%0A    public int getCols() %7B%0A        return (int)(width + 0.5);%0A    %7D%0A%0A    // add method%0A    public double getWidth() %7B%0A        return width;%0A    %7D%0A%0A    public void addAgent(Cell a) %7B%0A        agents.addFirst(a);%0A    %7D%0A%0A    public void removeAgent(Cell a) %7B%0A        agents.remove(a);%0A    %7D%0A%0A    public ArrayList%3CCell%3E getAgents() %7B%0A        return agents.toArrayList();%0A    %7D%0A%0A    public String toString() %7B%0A        ArrayList%3CString%3E s = new ArrayList%3CString%3E();%0A%0A        for(int i=0;i%3Cheight;i++) %7B%0A            for(int j=0;j%3Cwidth;j++) %7B%0A                s.add(%22 %22);%0A            %7D%0A            s.add(%22%5Cn%22);%0A        %7D%0A%0A        for( Cell item: agents ) %7B%0A            int r = item.getRow();%0A            int c = item.getCol();%0A%0A            if(r %3E= 0 && r %3C height && c %3E= 0 && c %3C width ) %7B%0A                int index = r * (this.getCols() + 1) + c;%0A                s.set( index, item.toString() );%0A            %7D%0A        %7D%0A%0A        String sout = %22%22;%0A        for( String a: s ) %7B%0A            sout += a;%0A        %7D%0A%0A        return sout;%0A    %7D%0A%0A    public void advance() %7B%0A        // put the agents in random oder%0A        ArrayList%3CCell%3E items = agents.toShuffledList();%0A%0A        // update the state of each agent%0A        for (Cell item: items) %7B%0A            item.updateState( this );%0A        %7D%0A    %7D%0A%0A    public static void main(String argv%5B%5D) throws InterruptedException %7B%0A        int rows = 240;%0A        int cols = 240;%0A        int N = 300;%0A        Landscape landscape = new Landscape(rows, cols);%0A        Random gen = new Random();%0A%0A        // Create a landscape display to see the game graphically run on%0A        LandscapeDisplay display = new LandscapeDisplay(landscape, 2);%0A        display.update();%0A        Thread.sleep(100);%0A%0A    %7D%0A%0A%7D%0A

Create Landscape.java