Changeset 114 in tmcsimulator for trunk/src/atmsdriver/model
- Timestamp:
- 10/14/2017 10:11:04 AM (9 years ago)
- Location:
- trunk/src/atmsdriver/model
- Files:
-
- 3 edited
-
Highways.java (modified) (1 diff)
-
LoopDetector.java (modified) (2 diffs)
-
Station.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/atmsdriver/model/Highways.java
r103 r114 211 211 public void writeToFEP() { 212 212 try { 213 Socket sock = new Socket(FEPHostName , FEPPortNum);213 Socket sock = new Socket(FEPHostName /*"192.168.251.130"*/, 8080); 214 214 PrintWriter out = new PrintWriter(sock.getOutputStream(), true); 215 215 out.println(this.toXML()); -
trunk/src/atmsdriver/model/LoopDetector.java
r103 r114 22 22 23 23 /* dynamic data */ 24 p rivateint vol;25 p rivateint occ;24 public int vol; 25 public int occ; 26 26 private int spd; 27 27 … … 34 34 35 35 /* Init dynamic data */ 36 this.vol = 0;36 this.vol = 100; 37 37 this.spd = 0; 38 this.occ = 0;38 this.occ = 100; 39 39 } 40 40 -
trunk/src/atmsdriver/model/Station.java
r109 r114 50 50 this.routeNumber = hwy; 51 51 52 this.MLTotVol = 0; 53 this.OppTotVol = 0; 52 this.MLTotVol = getMLTotVol(); 53 this.OppTotVol = getOPPTotVol(); 54 } 55 56 private int getMLTotVol() 57 { 58 int mlTotVol = 0; 59 for(LoopDetector loop : loops) 60 { 61 if(loop.loopLocation.startsWith("ML")) 62 { 63 mlTotVol += loop.vol; 64 } 65 } 66 return mlTotVol; 67 } 68 69 private int getOPPTotVol() 70 { 71 int oppTotVol = 0; 72 for(LoopDetector loop : loops) 73 { 74 if(loop.loopLocation.startsWith("OP")) 75 { 76 oppTotVol += loop.vol; 77 } 78 } 79 return oppTotVol; 54 80 } 55 81 … … 143 169 // vol and occ along with each color. Then the updateLoop call 144 170 // below could be update(dotColor.volume, dotColor.occ, speed) 145 int volume = 0;146 int occ = 0;171 int volume = 10; 172 int occ = 10; 147 173 int speed = 0; 148 174 loop.updateLoop(volume, occ, speed);
Note: See TracChangeset
for help on using the changeset viewer.
