class ToyGraph extends Graph { ToyGraph(int numAgents, int agentSize) { super(numAgents, agentSize); constructToyStadium(); registerGraph(); } // ========== Geometry ========== void constructToyStadium() { //createPolyArc(r, cx,cy,cz, n, a,da,dy, type) //AList stad2top = createPolyArc(400, 400,0,400, 30, 0.0,(3*PI/2),0.0, Corridor); AList stad2top = createPolyArc(500, 500,0,500, 30, 0.0,(3*PI/2),0.0, Corridor); tiltPolyArc(stad2top,150.0); //AList stad2bot = createPolyArc(300, 400,100,400, 30, 0.0,(3*PI/2),0.0, Corridor); AList stad2bot = createPolyArc(350, 500,100,500, 30, 0.0,(3*PI/2),0.0, Corridor); tiltPolyArc(stad2bot,100.0); ArrayList stat2mesh = createMesh(stad2top,stad2bot, 10, Aisle, Row); AList stad1top = createPolyArc(600, 600,200,600, 50, 0.0,(3*PI/2),0.0, Corridor); //tiltPolyArc(stad1top,150.0); tiltPolyArc(stad1top,50f); AList stad1bot = createPolyArc(400, 600,300,600, 50, 0.0,(3*PI/2),0.0, Corridor); //tiltPolyArc(stad1bot,100.0); ArrayList stat1mesh = createMesh(stad1top, stad1bot, 20, Aisle, Row); //AList stairs0 = createPolyArc(50, -100,350,400, 50, 3*PI/2,6*PI,-300, Ramp); //AList stairs1 = createPolyArc(50, 400,350,-100, 50, 0*PI/2,-6*PI,-300, Ramp); AList stairs0 = createPolyArc(50, -50,300,400, 50, 3*PI/2,6*PI,-250, Ramp); AList stairs1 = createPolyArc(50, 400,300,-50, 50, 0*PI/2,-6*PI,-250, Ramp); //connectClosestPair(stairs0, stad1bot, Ramp); connectClosestPair(stairs0, stad1top, Ramp); //connectClosestPair(stairs0, stad2bot, Ramp); connectClosestNode((Node)stairs0.last(), stad2top, Ramp); stairs0.first().setType(Exit); //connectClosestPair(stairs1, stad1bot, Ramp); connectClosestPair(stairs1, stad1top, Ramp); //connectClosestPair(stairs1, stad2bot, Ramp); connectClosestNode((Node)stairs1.last(), stad2top, Ramp); stairs1.first().setType(Exit); // Note: We build a Label by general data manipulators, then call // setLabelByData so that the label variable is set in Base. Nodes.setData(Base.Label, ""); stad1top.setDataByIndex(Base.Label,"L","Top"); stad1bot.setDataByIndex(Base.Label,"L","Bot"); for(int i = 0; i0) connectNodePairs((AList)(columnNodes.get(i-1)), segments, type2); } return columnNodes; } AList createSegmentsBetween(Node n0, Node n1, int n, String type) { // return list excludes n0, n1 AList l = new AList(); float len = n0.lenTo(n1); float delta = len/(n+1); for(int i = 0; i