Changeset 186 in tmcsimulator for trunk/src/atmsdriver/model/LoopDetector.java


Ignore:
Timestamp:
10/28/2017 06:48:11 PM (9 years ago)
Author:
jtorres
Message:

Highways.java, FEPLine.java, LoopDetector?.java, Station.java: reconfigured the getHighwaysMeta() function to a toCondensedFormat(boolean MetaDataOnly?) method. By specifying MetaDataOnly? as true, you get the same output as the previous getHighwaysMeta() function. By specifying MetaDataOnly? as false, you get the new condensed format needed to send to the FEPSim over the socket. This allows us to use the same function to get a meta data dump, as well as get the highways data format needed for FEPSim socket. HighwaysParser?.cpp: removed the old tinyxml code, set up skeleton for new parser. NetworkReader?.h: deleted, and added HighwaysParser?.h. LoadSadDotsTest?.java and StationTest?.java: configured to use new toCondensedFormat method instead of getHighwaysMeta.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/atmsdriver/model/LoopDetector.java

    r184 r186  
    6868    } 
    6969     
    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) 
    7986    { 
    8087        StringBuilder build = new StringBuilder(); 
     
    8390        build.append(Integer.toString(this.laneNum)); 
    8491        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        } 
    86105        build.append("\n"); 
    87106        return build.toString(); 
Note: See TracChangeset for help on using the changeset viewer.