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 | ***********************************************************************************/ |
---|
6 | package vnsim.vehicular.scenarios; |
---|
7 | |
---|
8 | |
---|
9 | import java.util.Vector; |
---|
10 | |
---|
11 | import vnsim.vehicular.simulator.Location; |
---|
12 | |
---|
13 | |
---|
14 | public class EntryScenario implements java.io.Serializable { |
---|
15 | |
---|
16 | /** <code>serialVersionUID</code> */ |
---|
17 | private static final long serialVersionUID = -5883719321862303634L; |
---|
18 | |
---|
19 | public Location entry; |
---|
20 | |
---|
21 | public int flow; // vehicles/hour |
---|
22 | |
---|
23 | public Vector<Integer> percentsDriverTypes; |
---|
24 | |
---|
25 | public Vector<EntryExitScenario> entryExits; |
---|
26 | |
---|
27 | |
---|
28 | public EntryScenario(Location entry) { |
---|
29 | this.entry = entry; |
---|
30 | this.flow = 0; |
---|
31 | this.percentsDriverTypes=new Vector<Integer>(); |
---|
32 | this.entryExits=new Vector<EntryExitScenario>(); |
---|
33 | } |
---|
34 | |
---|
35 | public boolean equals(EntryScenario es) { |
---|
36 | if (entry.equals(es.entry)) { |
---|
37 | return true; |
---|
38 | } else { |
---|
39 | return false; |
---|
40 | } |
---|
41 | } |
---|
42 | |
---|
43 | public EntryExitScenario getEntryExitScenarioForExit(Location l){ |
---|
44 | EntryExitScenario exs=null; |
---|
45 | |
---|
46 | for(int i=0;i<this.entryExits.size();i++){ |
---|
47 | if(this.entryExits.elementAt(i).exit.equals(l)){ |
---|
48 | exs=this.entryExits.elementAt(i); |
---|
49 | break; |
---|
50 | } |
---|
51 | } |
---|
52 | return exs; |
---|
53 | } |
---|
54 | |
---|
55 | |
---|
56 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.