Changeset 186 in tmcsimulator for trunk/src/atmsdriver
- Timestamp:
- 10/28/2017 06:48:11 PM (9 years ago)
- Location:
- trunk/src/atmsdriver
- Files:
-
- 5 edited
-
ATMSDriver.java (modified) (1 diff)
-
model/FEPLine.java (modified) (2 diffs)
-
model/Highways.java (modified) (1 diff)
-
model/LoopDetector.java (modified) (2 diffs)
-
model/Station.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/atmsdriver/ATMSDriver.java
r184 r186 116 116 Integer.parseInt(ATMSDriverProperties.getProperty( 117 117 PROPERTIES.FEP_WRITER_PORT.name))); 118 System.out.println(highways.toCondensedFormat(false)); 118 119 // create the exchange reader 119 120 exchangeReader = new ExchangeReader(); -
trunk/src/atmsdriver/model/FEPLine.java
r184 r186 37 37 } 38 38 39 /** 40 * Returns the FEPLine meta data in string format 41 * @return FEPLine metadata 39 /** Returns a string of highways data. If MetaDataOnly is true, you get a full 40 * dump of the highways meta data, which does not include dynamic loop values, 41 * and does include the string location names. If MetaDataOnly is false, 42 * dynamic loop values are included, and unnecessary information like string 43 * location values are included. 44 * 45 * The FEPSimulator takes in the toCondensedFormat() output, with a MetaDataOnly 46 * value of false, over the socket. 47 * 48 * The MetaDataOnly flag should be used to get a full dump of the highways 49 * information. This was used to get the highways_fullmap.txt output. 50 * 51 * @param MetaDataOnly Whether you want meta data, or a full dump for FEPSim 52 * @return String, highways data in condensed format 42 53 */ 43 public String getLineMeta()54 public String toCondensedFormat(boolean MetaDataOnly) 44 55 { 45 56 StringBuilder build = new StringBuilder(); … … 50 61 build.append(Integer.toString(this.stations.size())); 51 62 build.append("\n"); 52 for (Station station : stations)63 for(Station station : stations) 53 64 { 54 build.append(station. getStationMeta());65 build.append(station.toCondensedFormat(MetaDataOnly)); 55 66 } 56 67 return build.toString(); -
trunk/src/atmsdriver/model/Highways.java
r184 r186 354 354 } 355 355 } 356 357 /** 358 * Returns the highways metadata in condensed form. This function took the 359 * highways model and wrote it into condensed form. It is also useful for 360 * testing. 361 * 362 * @return the highways meta data string 363 */ 364 public String getHighwaysMeta() 365 { 366 StringBuilder build = new StringBuilder(); 367 build.append(lines.size()); 368 build.append("\n"); 369 for (FEPLine line : lines) 370 { 371 build.append(line.getLineMeta()); 372 } 373 return build.toString(); 374 } 375 356 357 /** Returns a string of highways data. If MetaDataOnly is true, you get a full 358 * dump of the highways meta data, which does not include dynamic loop values, 359 * and does include the string location names. If MetaDataOnly is false, 360 * dynamic loop values are included, and unnecessary information like string 361 * location values are included. 362 * 363 * The FEPSimulator takes in the toCondensedFormat() output, with a MetaDataOnly 364 * value of false, over the socket. 365 * 366 * The MetaDataOnly flag should be used to get a full dump of the highways 367 * information. This was used to get the highways_fullmap.txt output. 368 * 369 * @param MetaDataOnly Whether you want meta data, or a full dump for FEPSim 370 * @return String, highways data in condensed format 371 */ 372 public String toCondensedFormat(boolean MetaDataOnly) 373 { 374 StringBuilder build = new StringBuilder(); 375 build.append(lines.size()); 376 build.append("\n"); 377 for(FEPLine line : lines) 378 { 379 build.append(line.toCondensedFormat(MetaDataOnly)); 380 } 381 return build.toString(); 382 } 383 376 384 /** 377 385 * Returns the Highways model data in XML format. -
trunk/src/atmsdriver/model/LoopDetector.java
r184 r186 68 68 } 69 69 70 /** 71 * Returns the loop metadata in condensed form. 72 * This is just a quick script function to make a proper highway 73 * metadata configuration file, so that we can read the network 74 * faster. 75 * 76 * @return loop metadata 77 */ 78 public String getLoopMeta() 70 /** Returns a string of highways data. If MetaDataOnly is true, you get a full 71 * dump of the highways meta data, which does not include dynamic loop values, 72 * and does include the string location names. If MetaDataOnly is false, 73 * dynamic loop values are included, and unnecessary information like string 74 * location values are included. 75 * 76 * The FEPSimulator takes in the toCondensedFormat() output, with a MetaDataOnly 77 * value of false, over the socket. 78 * 79 * The MetaDataOnly flag should be used to get a full dump of the highways 80 * information. This was used to get the highways_fullmap.txt output. 81 * 82 * @param MetaDataOnly Whether you want meta data, or a full dump for FEPSim 83 * @return String, highways data in condensed format 84 */ 85 public String toCondensedFormat(boolean MetaDataOnly) 79 86 { 80 87 StringBuilder build = new StringBuilder(); … … 83 90 build.append(Integer.toString(this.laneNum)); 84 91 build.append(" "); 85 build.append(this.loopLocation); 92 if(!MetaDataOnly) 93 { 94 build.append(" "); 95 build.append(this.occ); 96 build.append(" "); 97 build.append(this.vol); 98 build.append(" "); 99 build.append(this.spd); 100 } 101 else 102 { 103 build.append(this.loopLocation); 104 } 86 105 build.append("\n"); 87 106 return build.toString(); -
trunk/src/atmsdriver/model/Station.java
r184 r186 88 88 return oppTotVol; 89 89 } 90 91 /** 92 * Returns the station metadata in condensed form. This is just a quick 93 * script function to make a proper highway metadata configuration file, so 94 * that we can read the network faster. 95 * 96 * @return station metadata 97 */ 98 public String getStationMeta() 90 91 /** Returns a string of highways data. If MetaDataOnly is true, you get a full 92 * dump of the highways meta data, which does not include dynamic loop values, 93 * and does include the string location names. If MetaDataOnly is false, 94 * dynamic loop values are included, and unnecessary information like string 95 * location values are included. 96 * 97 * The FEPSimulator takes in the toCondensedFormat() output, with a MetaDataOnly 98 * value of false, over the socket. 99 * 100 * The MetaDataOnly flag should be used to get a full dump of the highways 101 * information. This was used to get the highways_fullmap.txt output. 102 * 103 * @param MetaDataOnly Whether you want meta data, or a full dump for FEPSim 104 * @return String, highways data in condensed format 105 */ 106 public String toCondensedFormat(boolean MetaDataOnly) 99 107 { 100 108 StringBuilder build = new StringBuilder(); … … 111 119 build.append(Integer.toString(loops.size())); 112 120 build.append(" "); 113 build.append(this.location); 121 if(MetaDataOnly) 122 { 123 build.append(this.location); 124 } 114 125 build.append("\n"); 115 126 for (LoopDetector loop : loops) 116 127 { 117 build.append(loop. getLoopMeta());128 build.append(loop.toCondensedFormat(MetaDataOnly)); 118 129 } 119 130 return build.toString();
Note: See TracChangeset
for help on using the changeset viewer.
