示例#1
0
 public void initialAction() {
   randomMeeting();
   neighborMeeting();
   graphLayout.updateLayout();
   surface.updateDisplay();
   if (showHist) degreeDist.step();
   if (showPlot) graph.step();
 }
示例#2
0
 public void begin() {
   buildModel();
   buildDisplay();
   buildSchedule();
   graphLayout.updateLayout();
   surface.display();
   if (showHist) degreeDist.display();
   if (showPlot) graph.display();
 }
示例#3
0
  public void mainAction() {
    randomMeeting();
    neighborMeeting();
    removeRandomFriendship();
    graphLayout.updateLayout();
    surface.updateDisplay();
    if (showHist) degreeDist.step();
    if (showPlot) graph.step();

    // System.out.println(NetUtilities.getComponents(agentList).size());

  }
示例#4
0
  public void setup() {
    Random.createUniform();
    if (surface != null) surface.dispose();
    if (degreeDist != null) degreeDist.dispose();
    if (graph != null) graph.dispose();

    surface = null;
    schedule = null;
    degreeDist = null;
    graph = null;

    System.gc();

    surface = new DisplaySurface(this, "JinGirModelII Display");
    registerDisplaySurface("Main Display", surface);
    schedule = new Schedule();
    agentList = new ArrayList();
    worldXSize = 500;
    worldYSize = 500;
  }
示例#5
0
  /*
   * Creates a histogram of the degree distribution.
   */
  private void makeHistogram() {

    degreeDist = new Histogram("Degree Distribution", maxDegree + 1, 0, maxDegree + 1, this);

    degreeDist.createHistogramItem("Degree Distribution", agentList, "getOutDegree");
  }