@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)); } }
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; } }