public void setNumberOfAgents (int numberOfAgents) {
	
	if (this.numberOfAgents != numberOfAgents) {
	    
	    this.numberOfAgents = numberOfAgents;
	    angle = 360.0 / (double)numberOfAgents;
	    
	    makeAgents();
	    canvas.setAgents(agents);
	    
	    // If we're already showing the first agents, repaint.
	    
	    if (smallWorldMenuItem.isEnabled() == true) {
		canvas.repaint();
	    }
	    
	}
	
    }