/************************************************************************************ * 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; /** * @author Victor-Radu * */ import java.io.File; import java.io.PrintWriter; import java.util.ArrayList; import vnsim.applications.adaptiveTL.WirelessTrafficLight; import vnsim.applications.trafficview.SimulatedCarInfo; import vnsim.core.*; import vnsim.gui.Display; import vnsim.vehicular.routePlan.RoutingConstants; import vnsim.vehicular.routePlan.cityRouting.WeekCongestion; public class Globals { public static int MAXCROSS = 8; public static int RT1_length = 230; //Tiger Record Type 1 length = 228 + 2 (crlf) public static int RT2_length = 210; //Tiger Record Type 2 length = 208 + 2 (crlf) public static int LOG_LINE_LEN = 55; //GARMIN Text Output Protocol public static double MAXSEGLEN=0.006; //maximum distance between consecutive points on a road public static Map map; // last week congestions // first is the crossroad index then the road segment index public static ArrayList> lastWeekCongestions; public static String scenarioName; public static Point minPoint, maxPoint; // Given the peano key of your gps location and the position in the sorted PeanoKey // vector where it would fit, for finding the closest point on a road // you need to find the minimum distance to a point (PeanoKey) in a certain range // from that position. public static int PEANOKEY_SEARCH_RANGE = 10000; //If the minimum distance to a point on a roads is greater than a certain //constant, the gps location should be considered out of the map public static double CLOSEST_PEANOKEY_MAXDIST = 0.06; public static int FPS = 10; //iterations per second (mobility simulator) public static int executionFPS = 100; //iterations per second (simulation) public final static int SECOND = executionFPS; public final static int MINUTE = 60 * SECOND; public final static int HOUR = 60 * MINUTE; public static long NEIGHBOR_EXPIRES = 2 * SECOND; public static long PROMISCUOUS_NEIGHBOR_EXPIRES = 1 * MINUTE; public static long TRAFFICLIGHT_NEIGHBOR_EXPIRES //= 30 * SECOND; = 10 * Globals.MINUTE; //public static String inFile = System.getProperty("user.home")+File.separatorChar+"traces.dat"; public static String inFile="traces.dat"; public static Display demo; public static Engine engine; public static Integer mutex = new Integer(0); public static int flag = 1; // Protocol codes (message types) public final static byte PROT_NEIGHBOR_DISCOVERY = 0; public final static byte PROT_SIMPLE_TEXT = 2; public final static byte PROT_SETOFCARS = 1; public final static byte PROT_TL_FEEDBACK = 3; public final static byte PROT_TL_LSA = 4; public final static byte VITP_PROT = 5; public final static byte ROAD_PLANNING_PROT = 6; public final static byte ROAD_METRICS_PROT = 11; //ezcab public final static byte PROT_EZCAB = 13; public final static int TYPE_EZCAB = -10; //nush ce sa pun public static boolean probabilisticModel = true; public static final int NONAGG_RECORD_SIZE = 27; public static final int TL_FEEDBACK_SIZE = 400; public final static int WIRELESS_TRANSMISSION_TIME = 8; // ms public static int WIRELESS_TRANSMISSION_FRAMES; // ms public final static int MTU_SIZE = 2300; public static int PERCENT_EQUIPPED_VEHICLES=60; public final static int MESSAGE_PROCESSING_TIME=4; //ms //Traffic engineering parameters public final static double LANE_WIDTH = 2.5; // meters public final static double PEDESTRIAN_SPEED = 1; // m/sec public final static int MIN_WALK_LIGHT_TIME = 4 * SECOND; public final static int PEDESTRIAN_STARTUP_TIME = 4 * SECOND; public final static int ANALYSIS_PERIOD = 3 * MINUTE; // m/sec public final static int MAXIMUM_CYCLE_LENGTH = 120; //s public final static double VEHICLE_LENGTH = 6; // meters public final static int SATURATION_FLOW = 1500; // veh/sec/lane public static int SOCIALNETWORK = 0; public final static int DEFAULT_YELLOW_TIME = 3; //s public final static int DEFAULT_ALL_RED = 2; //s // the operational flow. Xc = 1 => intersection works at full capacity public static double Xc = 1.0 / 0.95; public static final int RED = 1; public static final int YELLOW = 2; public static final int GREEN = 3; public static final double QUEUEDISCHARGEFLOW = 0.45; public static final double CARSPERKM = 1.0 / 0.010 ; public static double DEMAND_DISTANCE_ON_FREE_FLOW = 0.1; public static WirelessTrafficLight monitorWTL = null; public static ArrayList monitoredCars = new ArrayList(); public static long volume = 0; public static long demand = 0; static String pwname = "Adaptive5Var"+System.currentTimeMillis()+".txt"; //public static String variationsFile = "variations5.txt"; public static String variationsFile = ".//variations//variations5.txt"; public static PrintWriter pw = null; public static PrintWriter pwxc = null; static{ try{ pw = new PrintWriter(System.out); pwxc = new PrintWriter(System.out); // pw = new PrintWriter(new FileWriter(pwname)); // pwxc = new PrintWriter(new FileWriter("X"+pwname)); // pwxc.println("Ciurel Xc = 0.95; cycle 120; carry- Colisiuni"); }catch(Exception e){ } } public static boolean comView = false; public static RoutingConstants routePlanConstants = new RoutingConstants(); public static long packets = 0; public static long collided = 0; public static long lost = 0; public static long interfered = 0; public static double maxRange = 10000; //Petroaca - emergency vehicle protocol code public final static byte PROT_EMERGENCY=7; //Serban - SCFT protocol public final static int PROT_SCFT = 9; // the 2 types of protocol simulation public static int PROTOCOL_80211=100; public static int PROTOCOL_DSRC=101; //the 2 types of propagation model public static final int TWO_RAY_GROUND=200; public static final int SHADOWING=201; public static final int RICEAN=202; //Petroaca - the SINRThreshold for BPSK modulation ( in dBs) public static double SINRThresholdBPSK_80211=0.01; public static double SINRThresholdBPSK_DSRC=0.016; //Petroaca - the thermalNoise that every station receives (in dBms) public static double ThermalNoise=-92; //Petroaca - the limit of power received a frame must have to not be ignored by the NoiseMonitor -in W public static double CS_THRESHOLD_TRG=5.011872*Math.pow(10,-16); //the collision threshold public static double CP_THRESHOLD=4.0; //the received power threshold in W for tworayforund prop public static double RX_THRESHOLD_TRG=5.82587*Math.pow(10,-14); public static double CS_THRESHOLD_S=3.1622777*Math.pow(10,-15); public static double RX_THRESHOLD_S=3.1622777*Math.pow(10,-14); //variables for Ricean fading public static double RICEAN_K=20; //in dB public static double RICEAN_MAX_VELOCITY_FREE=27.77; //in m/s public static double RICEAN_MAX_VELOCITY_URBAN=11.11; //in m/s public static String RICEAN_FILE_NAME="rice_table.txt"; //Petroaca - the system loss for the propagation classes public static double SYSTEM_LOSS=1.0; public static final long LIGHT_SPEED = 299792458; public static final long DSRC_FREQUENCY = 5900000000L; //Petroaca - the wavelength of the signal for the propagation modules public static double DSRC_LAMBDA=(double)LIGHT_SPEED/DSRC_FREQUENCY; // L= speed_of_light * 1/frequency //Petroaca - the gain of the antenna used on the station public static double ANTENNA_GAIN=1.0; //in dB // height of the antenna in metres public static double AH=1.5; //the power of the signal at the transmitter 0.031622777 public static double TRANSMITTER_POWER_80211=0.031622777; public static double TRANSMITTER_POWER_DSRC=3.1622777; //signal spread = half-width of the signal ( in Hz) public static double DSRC_SIGNAL_SPREAD=5.0*Math.pow(10,6); //data rate ( Mbps ) public static double DSRC_DATA_RATE=6000000; //pclp transmission rate in Mbps public static double DSRC_PCLP_RATE=1000000; //packet error rate threshold public static double DSRC_PER_THRESHOLD=Math.pow(10,-15); public static int DSRC_PREAMBLE_LENGTH=12; //in bytes public static int DSRC_PHYHEADER_LENGHT=3; //in bytes public static int DSRC_MACHEADER_LENGHT=32; //in bytes //Petroaca - variables used in the shadowing propagation model to calculate the received power of a frame public static double PATH_LOSS_EXPONENT_FREE=2.0; //with no to little obstruction public static double PATH_LOSS_EXPONENT_URBAN=2.3; //with considerable obstruction public static double SHADOWING_DEVIATION=4.0; // in dB public static double REFERENCE_DISTANCE=1.0; //in metres public static long RANDOM_SEED=0; // the 3 states in which the state machine of the physical layer can be at any one time public static final int IDLE=0; public static final int TXing=1; public static final int RXing=2; //the 2 states of the carrier sense status of the mac layer public static final int CCA_BUSY=300; public static final int CCA_IDLE=301; //Petroaca - the RX ,TX states of the MAC layer public static final int RX_RECV=5; public static final int RX_IDLE=6; public static final int TX_RECV=7; public static final int TX_IDLE=8; public static long DSRC_PACKETS_LOST_WEAK=0; public static long DSRC_PACKETS_LOST_CORRUPTED=0; public static long DSRC_PACKETS_LOST_COLLISION=0; public static long DSRC_PACKETS_LOST_TX=0; public static long DSRC_PACKETS_LOST_RX=0; public static long DSRC_PACKETS_LOST_PER=0; public static long DSRC_PACKETS_RECEIVED_OK=0; public static long DSRC_PACKETS_TOTAL=0; public static long DSRC_PACKETS_SEND_FALIURE_RX=0; public static long DSRC_PACKETS_SEND_FALIURE_NOISE=0; public static long DSRC_SEND=0; public static long p80211_SEND=0; public static double TEST_DIST=200; //in m public static double RECEPTION_RATE_THRESHOLD=50; //Petroaca - FCW crash speed thresholds public static double SPEED_DIFFERENCE=40; //in km/h //Petroaca Cooperative Colision Warning application information refresh time public static double CCW_REFRESH_TIME=10; //Petroaca - CCW application statistical parameters public static long CUMMULATIVE_PACKETS_FV=0; public static long CUMMULATIVE_PACKETS_NFV=0; public static long CUMMULATIVE_PACKETS_LAV=0; public static long CUMMULATIVE_PACKETS_RAV=0; public static double IRT_FV=0; public static double IRT_NFV=0; public static double IRT_LAV=0; public static double IRT_RAV=0; public static double PSP_FV=0; public static double PSP_NFV=0; public static double PSP_LAV=0; public static double PSP_RAV=0; public static long EMERGENCY_RECEIVED=0; public static long EMERGENCY_SENT=0; public static double TRANSMITTER_POWER=TRANSMITTER_POWER_DSRC; public static double SINRThresholdBPSK=SINRThresholdBPSK_DSRC; public static boolean DIFFERENTIAL_CW=true; public static boolean MULTI_CHANNEL=true; public static int NO_FEP_PROC = 8; }