public void setAgents(Vector agents) {
        
        this.agents = agents;
        
        // Recalculate the graph space angle incase we need it,
        // and adjust the number of Agents where appropriate.
        
        if (numberOfAgents != agents.size()) {
            numberOfAgents = agents.size();
            angle = 360.0 / (double)numberOfAgents;
            options.setAgentsField(numberOfAgents);
        }
        
        // If necessary, give the default (random) geographical and (circlular) graph space values.
        
        for (int i = 0; i < agents.size(); i++) {
            Agent agent = (Agent)agents.elementAt(i);
            if (agent.getX() == -1) agent.setX((int)(Math.random() * width));
            if (agent.getY() == -1) agent.setY((int)(Math.random() * height));
            double positionAngle = ((double)i * angle * Math.PI)/180.0;
	    if (agent.getGraphX() == -1) agent.setGraphX((int)(radius * Math.sin(positionAngle)));
            if (agent.getGraphY() == -1) agent.setGraphY((int)(radius * Math.cos(positionAngle)));
        }

        // Set up GUI.
        
        canvas.setAgents(agents);
        smallWorldMenuItem.setEnabled(true);
        saveMenuItem.setEnabled(true);
        runMenuItem.setEnabled(true);
        helpLabel.setText(" Click on Agents for info");
        doLayout();
        canvas.repaint();
        
    } // End of setAgents.