Changeset 184 in tmcsimulator for trunk/src/atmsdriver/model/Station.java


Ignore:
Timestamp:
10/28/2017 05:24:02 PM (9 years ago)
Author:
jtorres
Message:

highways.java: converted to immutable, removed use of FEPLineLoader and added loadLines(), loadLine(), loadStation(), and loadLoop() methods. Renamed loadHighways() to configureHighways(), renamed writeHighwaysMeta() to getHighwaysMeta() which now returns a String containing metadata instead of opening a file and writing to it, which is more flexible. FEPLineLoader.java: deleted, no longer need it. FEPLine.java: converted to immutable, removed unnecessary member variables and adjusted all methods accordingly. Station.java: MLTotVol() and OppTotVol?() are now being updated at end of updateByDirection(). ATMSDriver.java: Now using one config file: highways_fullmap.txt, as opposed to the older lds.txt and loop.txt files. config/vds_data: added highways_fullmap.txt. config/atms_driver_config.properties, atms_driver_config_local.properties: updated config to reflect use of highways_fullmap.txt instead of old loop.txt and lds.txt configuration. ATMSBatchDriver.java: conformed highways initialization in constructor to reflect use of highways_fullmap.txt

File:
1 edited

Legend:

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

    r180 r184  
    11package atmsdriver.model; 
    22 
    3 import atmsdriver.ConsoleTrafficDriver; 
    43import atmsdriver.model.LoopDetector.DOTCOLOR; 
    54import java.util.List; 
     
    87 
    98/** 
    10  *A Station (LDS or Loop Detector Station) represents a group of lane detectors 
     9 * A Station (LDS or Loop Detector Station) represents a group of lane detectors 
    1110 * across all lanes at a particular point on a highway.  A station is 
    1211 * identified by its highway number and postmile.  A station has an associated 
    1312 * direction used to establish which direction is Main and which is Opposite. 
    1413 * The MLTotVol and OppTotVol for a station can be dynamically updated. 
    15  * A station has other attributes: lineNum, ldsID, drop, and location used 
    16  * by the FEP.  A station can be compared to other stations by its postmile. 
     14 * A station has other attributes: lineNum, ldsID, drop, and location which are 
     15 * used by the FEP.  A station can be compared to other stations by its postmile. 
    1716 * 
    1817 * @author John A. Torres 
     
    5453    } 
    5554     
     55    /** 
     56     * Calculates the total ML Volume. 
     57     *  
     58     * @return total ML volume. 
     59     */ 
    5660    private int getMLTotVol() 
    5761    { 
     
    6771    } 
    6872     
     73    /** 
     74     * Calculates the total OPP Volume 
     75     *  
     76     * @return total OPP volume. 
     77     */ 
    6978    private int getOPPTotVol() 
    7079    { 
     
    170179            } 
    171180        } 
    172     } 
    173     
     181         
     182        this.MLTotVol = getMLTotVol(); 
     183        this.OppTotVol = getOPPTotVol(); 
     184    } 
     185     
     186    /** 
     187     * Output for updateByDirection. Logs the update to the console. 
     188     *  
     189     * @param dotcolor 
     190     * @param OPP_ML  
     191     */ 
    174192    private void outputUpdateMessage(DOTCOLOR dotcolor, String OPP_ML) 
    175193    { 
     
    181199    } 
    182200     
     201    /** 
     202     * XML tags used for toXML() method. 
     203     */ 
    183204    private static enum XML_TAGS 
    184205    { 
     
    203224        } 
    204225    } 
    205  
     226     
     227    /** 
     228     * Returns the Station data in XMLFormat. 
     229     *  
     230     * @param currElem The current XML <Station> element 
     231     */ 
    206232    public void toXML(Element currElem) 
    207233    { 
     
    264290    public static enum DIRECTION 
    265291    { 
    266  
    267292        NORTH, 
    268293        SOUTH, 
Note: See TracChangeset for help on using the changeset viewer.