Changeset 186 in tmcsimulator for trunk/src/atmsdriver/model/Highways.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/Highways.java

    r184 r186  
    354354        } 
    355355    } 
    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     
    376384    /** 
    377385     * Returns the Highways model data in XML format. 
Note: See TracChangeset for help on using the changeset viewer.