source: proiecte/ptvs/src/vnsim/vehicular/generator/NewCarEvent.java @ 31

Last change on this file since 31 was 31, checked in by (none), 14 years ago
File size: 993 bytes
Line 
1/************************************************************************************
2 * Copyright (C) 2008 by Politehnica University of Bucharest and Rutgers University
3 * All rights reserved.
4 * Refer to LICENSE for terms and conditions of use.
5 ***********************************************************************************/
6package vnsim.vehicular.generator;
7
8
9
10import java.util.Vector;
11
12import vnsim.vehicular.simulator.Location;
13import vnsim.vehicular.simulator.RouteSegment;
14
15public class NewCarEvent {
16        public int timestamp; //simulation time
17        public int index; //in the Mobility.entryScenarios array
18        public int period; //simulation time (rescheduling time)
19
20        public NewCarEvent(int timestamp, int index, int period) {
21                this.index=index;
22                this.timestamp=timestamp;
23                this.period=period;
24        }
25       
26        public int compareTo(NewCarEvent o) {
27                if(this.timestamp > o.timestamp)
28                        return 1;
29                if(this.timestamp==o.timestamp)
30                        return 0;
31                return -1;
32        }
33}
Note: See TracBrowser for help on using the repository browser.