Пример #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");
  }