Changeset 84 in tmcsimulator for trunk/src/atmsdriver


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

FEPSimulator.cpp: FEPSimulator socket server is now receiving full messages, no more partial messages over the TCP socket. General housekeeping on FEPSim.cpp, NetworkReader?.cpp, ATMSDriver.java, NetworkLoader?.java.

Location:
trunk/src/atmsdriver
Files:
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/atmsdriver/NetworkLoader.java

    r79 r84  
    22 
    33import atmsdriver.model.FEPLine; 
    4 import atmsdriver.model.LoopDetectorStation; 
     4import atmsdriver.model.Station; 
    55import atmsdriver.model.LoopDetector; 
    6 import atmsdriver.model.LoopDetectorStation.DIRECTION; 
     6import atmsdriver.model.Station.DIRECTION; 
    77import java.io.File; 
    88import java.io.FileNotFoundException; 
     
    1717 *  
    1818 *  The public method getFEPLines() method can be used to get all the FEPLines  
    19  * within a network. All other methods are private and are used to construct 
    20  * the FEPLines. 
    21  *  
    22  *  The "LDSFile" contains LoopDetectorStation and FEPLine information. 
    23  * ex. 
    24  *   < Insert file here > 
     19  within a network. All other methods are private and are used to construct 
     20  the FEPLines. 
     21  
     22  The "LDSFile" contains Station and FEPLine information. 
     23  ex. 
     24   < Insert file here > 
    2525 *  The "loopFile" contains individual LoopDetector information. 
    2626 *  ex. 
     
    157157                 
    158158                // Create each Station for the current FEPLine 
    159                 ArrayList<LoopDetectorStation> stns = new ArrayList<>(); 
     159                ArrayList<Station> stns = new ArrayList<>(); 
    160160                for(Integer stnNum : stnNums) 
    161161                { 
     
    165165                     
    166166                    // Create the Station and add to list for curr FEPLine 
    167                     LoopDetectorStation stn = 
     167                    Station stn = 
    168168                            createStation(stnNum, new Scanner(LDSFile), loops); 
    169169                    stns.add(stn); 
     
    181181     
    182182    // Creates  line 
    183     private FEPLine createLine(int lineNum, Scanner scLine, ArrayList<LoopDetectorStation> stns) 
     183    private FEPLine createLine(int lineNum, Scanner scLine, ArrayList<Station> stns) 
    184184    { 
    185185        FEPLine line = null; 
     
    239239     
    240240    // creates a Station 
    241     private LoopDetectorStation createStation(int stnNum, Scanner sc, ArrayList<LoopDetector> detectors) 
    242     { 
    243         LoopDetectorStation LDS = null; 
     241    private Station createStation(int stnNum, Scanner sc, ArrayList<LoopDetector> detectors) 
     242    { 
     243        Station LDS = null; 
    244244         
    245245        sc.nextLine(); 
     
    264264                double postmile = scLine.nextDouble(); 
    265265                String ldsName = getLocation(strLine); /************* DOESNT GRAB WHOLE???? *///// 
    266                 LDS = new LoopDetectorStation(lineNum, ldsID, drop, ldsName, detectors, fwy, dir, postmile); 
     266                LDS = new Station(lineNum, ldsID, drop, ldsName, detectors, fwy, dir, postmile); 
    267267                 
    268268                break; 
  • trunk/src/atmsdriver/model/FEPLine.java

    r79 r84  
    1919    /* Static FEPLine meta data */ 
    2020    final private int lineNum; 
    21     final private List<LoopDetectorStation> stations; 
     21    final private List<Station> stations; 
    2222    final private int count; 
    2323    // NOT SURE IF NEXT IS FINAL 
     
    2828    final private long scheduleSeq; 
    2929     
    30     public FEPLine(int lineNum, List<LoopDetectorStation> stations, int count, 
     30    public FEPLine(int lineNum, List<Station> stations, int count, 
    3131            int schedule, int lineInfo, long systemKey, long globalSeq, 
    3232            long scheduleSeq) 
     
    7979        Element stationsElement = theDoc.createElement(XML_TAGS.STATIONS.tag); 
    8080        lineElement.appendChild(stationsElement); 
    81         for(LoopDetectorStation station : stations) 
     81        for(Station station : stations) 
    8282        { 
    8383            station.toXML(stationsElement); 
  • trunk/src/atmsdriver/model/Station.java

    r79 r84  
    55import org.w3c.dom.Element; 
    66 
    7 /** A LoopDetectorStation is a simulation of a station in a traffic network. 
     7/** A Station is a simulation of a station in a traffic network. 
    88 *   
    9  *  A LoopDetectorStation (LDS) contains static meta data about the station, and 
    10  * two dynamic attributes, MLTotVol and OppTotVol.  
    11  *  
    12  * A single LDS contains multiple LoopDetectors, which 
    13  * contain data for a single lane on one direction of the freeway. A LDS 
    14  * is specific to a single freeway, direction, and postmile. 
     9 *  A Station (LDS) contains static meta data about the station, and 
     10  two dynamic attributes, MLTotVol and OppTotVol.  
     11  
     12  A single LDS contains multiple LoopDetectors, which 
     13  contain data for a single lane on one direction of the freeway. A LDS 
     14  is specific to a single freeway, direction, and postmile. 
    1515 * 
    1616 * @author John A. Torres 
    1717 * @version 9/10/2017 
    1818 */ 
    19 public class LoopDetectorStation { 
    20     /* Static LoopDetectorStation meta data */ 
     19public class Station implements Comparable { 
     20    /* Static Station meta data */ 
    2121    final private int lineNum; 
    2222    final private int ldsID; // double check 
     
    2828    final private DIRECTION direction; 
    2929     
    30     /* Dynamic LoopDetectorStation data */ 
     30    /* Dynamic Station data */ 
    3131    private int MLTotVol; 
    3232    private int OppTotVol; 
    3333     
    3434    /* Constructor */ 
    35     public LoopDetectorStation(int lineNum, int ldsID, int drop, 
     35    public Station(int lineNum, int ldsID, int drop, 
    3636            String location, List<LoopDetector> loops, int fwy,  
    3737            DIRECTION direction, double postmile) 
     
    4848        this.MLTotVol = 0; 
    4949        this.OppTotVol = 0; 
     50    } 
     51 
     52    @Override 
     53    public int compareTo(Object o) { 
     54         
    5055    } 
    5156     
Note: See TracChangeset for help on using the changeset viewer.