/************************************************************************************ * Copyright (C) 2008 by Politehnica University of Bucharest and Rutgers University * All rights reserved. * Refer to LICENSE for terms and conditions of use. ***********************************************************************************/ package vnsim.map.object; import java.util.ArrayList; import vnsim.vehicular.simulator.*; /** * @author Victor-Radu * */ public class Road implements Comparable, java.io.Serializable { /** serialVersionUID */ private static final long serialVersionUID = -5883719321862303634L; protected long id; protected String type; //Ave., St. or other protected String name; protected byte[] directionPrefix; protected byte[] directionSuffix; public ArrayList points = new ArrayList(); // sorted vector of points that are maximum Globals.MAXSEGLEN from each other public ArrayList crosses = new ArrayList(); // crosses wtih other roads protected int nextRdIdx = -1, // index of next segment along a road with the same name prevRdIdx = -1; // index of previous ... // both used just in the map building process protected byte[] roadinfo; // A41, A31 or other (see TIGER files specs) public SortedCarVector carsOnThisRoad=new SortedCarVector(); //added for simulation public int laneNo; public Road(){ } public void printRoad(boolean printPoints) { System.out.println("( " + id + " " + new String(directionPrefix) + " " + name + " " + new String(directionSuffix) + " " + type + " " + new String(roadinfo) + " " + points.size() + ")"); if (printPoints) for (int i=0; i < points.size();i++){ System.out.print("\t"+(Point)points.get(i)); if (i