@Override public void addAgent(final AgentSnapshotInfo position) { if (position.getAgentState() != AgentSnapshotInfo.AgentState.PERSON_AT_ACTIVITY) { this.positions.add(position); } }
private static Color standardColoringScheme(AgentSnapshotInfo agInfo) { if ( agInfo.getAgentState()==AgentState.PERSON_DRIVING_CAR ) { return redToGreenColorizer.getColorZeroOne(agInfo.getColorValueBetweenZeroAndOne()); } else if ( agInfo.getAgentState()==AgentState.PERSON_AT_ACTIVITY ) { return Color.ORANGE; } else if ( agInfo.getAgentState()==AgentState.PERSON_OTHER_MODE ) { return Color.MAGENTA; } else if ( agInfo.getAgentState()==AgentState.TRANSIT_DRIVER ) { return Color.BLUE; } else { return Color.YELLOW; } }
private static Color bvgColoringScheme(AgentSnapshotInfo agInfo) { if ( agInfo.getAgentState()==AgentState.PERSON_DRIVING_CAR ) { return Color.DARK_GRAY; } else if ( agInfo.getAgentState()==AgentState.PERSON_AT_ACTIVITY ) { return Color.ORANGE; } else if ( agInfo.getAgentState()==AgentState.TRANSIT_DRIVER ) { String idstr = agInfo.getId().toString(); if ( idstr.endsWith("_B") ) { return Color.MAGENTA; } else if ( idstr.endsWith("_T") ) { return Color.RED; } else if ( idstr.endsWith("_S")) { return Color.GREEN; } else if ( idstr.endsWith("_U")) { return Color.BLUE; } else { return Color.ORANGE; } } else { return Color.YELLOW; } }
private static Color gtfsColoringScheme(AgentSnapshotInfo agInfo) { if ( agInfo.getAgentState()==AgentState.PERSON_DRIVING_CAR ) { return Color.DARK_GRAY; } else if ( agInfo.getAgentState()==AgentState.PERSON_AT_ACTIVITY ) { return Color.ORANGE; } else if ( agInfo.getAgentState()==AgentState.TRANSIT_DRIVER ) { String idstr = agInfo.getId().toString(); if ( idstr.endsWith("bus") ) { return Color.MAGENTA; } else if ( idstr.endsWith("tram") ) { return Color.RED; } else if ( idstr.endsWith("rail")) { return Color.GREEN; } else if ( idstr.endsWith("subway")) { return Color.BLUE; } else { return Color.ORANGE; } } else { return Color.YELLOW; } }
private Color bvg2ColoringScheme(AgentSnapshotInfo agInfo) { if ( bvg2cnt < 1 ) { bvg2cnt++ ; Logger.getLogger(this.getClass()).info( "using bvg2 coloring scheme ...") ; } if ( agInfo.getAgentState()==AgentState.PERSON_DRIVING_CAR ) { return Color.DARK_GRAY; } else if ( agInfo.getAgentState()==AgentState.PERSON_AT_ACTIVITY ) { return Color.ORANGE; } else if ( agInfo.getAgentState()==AgentState.TRANSIT_DRIVER ) { String idstr = agInfo.getId().toString(); if ( idstr.contains("line_") && idstr.contains("-B-") ) { return Color.MAGENTA; } else if ( idstr.contains("line_") && idstr.contains("-T-")) { return Color.RED; } else if ( idstr.contains("line_SB")) { return Color.GREEN; } else if ( idstr.contains("line_U")) { return Color.BLUE; } else { return Color.ORANGE; } } else { return Color.YELLOW; } }
private static Color taxicabColoringScheme(AgentSnapshotInfo agInfo) { // ===============TAXI COLOURING=============== if (agInfo.getId().toString().startsWith("taxi")) { if (agInfo.getAgentState() == AgentState.PERSON_DRIVING_CAR) { return Color.YELLOW ; } else { return Color.BLACK ; } } else { //===============REGULAR COLOURING=============== return standardColoringScheme( agInfo ) ; } }
@Override public void writeDynData(ByteBuffer out) throws IOException { out.putFloat((float)0.) ; positions.clear(); this.src.getVisData().addAgentSnapshotInfo( positions); if (showParked) { out.putInt(positions.size()); for (AgentSnapshotInfo pos : positions) { writeAgent(pos, out); } } else { int valid = 0; for (AgentSnapshotInfo pos : positions) { if (pos.getAgentState() != AgentState.PERSON_AT_ACTIVITY) valid++; } out.putInt(valid); for (AgentSnapshotInfo pos : positions) { if (pos.getAgentState() != AgentState.PERSON_AT_ACTIVITY) writeAgent(pos, out); } } }
@Override public void addAgent(AgentSnapshotInfo position) { //drop all parking vehicles if (position.getAgentState() == AgentSnapshotInfo.AgentState.PERSON_AT_ACTIVITY) return; String buffer = position.getId().toString() + "\t" + (int)this.currentTime + "\t0\t0\t1\t0\t" + position.getColorValueBetweenZeroAndOne() // link(0), from node(0), lane(1), dist(0), speed + "\t1\t0\t" + position.getId().toString() // vehtype(1), acceleration(0), driver-id + "\t0\t" + position.getEasting() // # of passengers(0), easting + "\t" + position.getNorthing() + "\t0" // elevation + "\t0" // azimuth + "\t"+ "0" + "\n"; // user(0) try { out.write(buffer); } catch (IOException e) { e.printStackTrace(); } }
private static void writeAgent(AgentSnapshotInfo agInfo, ByteBuffer out) { String id = agInfo.getId().toString(); ByteBufferUtils.putString(out, id); Point2D.Double point = OTFServerQuadTree.transform(new Coord(agInfo.getEasting(), agInfo.getNorthing())); out.putFloat((float) point.getX()); out.putFloat((float) point.getY()); out.putInt(agInfo.getAgentState().ordinal() ) ; out.putInt(agInfo.getUserDefined()); out.putFloat((float)agInfo.getColorValueBetweenZeroAndOne()); }
private static void writeAgent(AgentSnapshotInfo pos, ByteBuffer out) { String id = pos.getId().toString(); ByteBufferUtils.putString(out, id); Point2D.Double point = OTFServerQuadTree.transform(new Coord(pos.getEasting(), pos.getNorthing())); out.putFloat((float) point.getX()); out.putFloat((float) point.getY()); out.putInt(pos.getUserDefined()); out.putFloat((float) pos.getColorValueBetweenZeroAndOne()); out.putInt(pos.getAgentState().ordinal()); }
@Override public void addAgent(final AgentSnapshotInfo info) { //drop all parking vehicles if (info.getAgentState() == AgentSnapshotInfo.AgentState.PERSON_AT_ACTIVITY) { return; } this.writeThisSnapshot = true ; Coord coord = this.coordTransform.transform(new Coord(info.getEasting(), info.getNorthing())); PointType point = kmlObjectFactory.createPointType(); point.getCoordinates().add(Double.toString(coord.getX()) + "," + Double.toString(coord.getY()) + ",0.0"); if ( info.getColorValueBetweenZeroAndOne() < 0.33 ) { this.timeGeometryRed.getAbstractGeometryGroup().add(kmlObjectFactory.createPoint(point)); } else if ( info.getColorValueBetweenZeroAndOne() < 0.66 ) { this.timeGeometryYellow.getAbstractGeometryGroup().add(kmlObjectFactory.createPoint(point)); } else { this.timeGeometryGreen.getAbstractGeometryGroup().add(kmlObjectFactory.createPoint(point)); } }
if ((info.getAgentState()== AgentState.PERSON_AT_ACTIVITY) && !OTFLinkAgentsHandler.showParked) continue; java.awt.geom.Point2D.Double xy = OTFServerQuadTree.transform(new Coord(info.getEasting(), info.getNorthing())); double xDist = xy.getX() - this.x;