Changeset 87 in tmcsimulator for trunk/src/atmsdriver/model/FEPLine.java


Ignore:
Timestamp:
10/10/2017 01:09:50 AM (9 years ago)
Author:
jtorres
Message:

merged branches/trunk into regular tmcsim/trunk. Changed Network.java to Highways.java. Highways.java: added writeToFEP(), updateSequences(), loadHighways(), and writeHighwaysMeta(). writeToFEP() is a socket client that communicates with FEPSimulator socket server. updateSequences() updates global and schedule sequences per the existing UCI plugin code and may not be necessary. loadHighways() loads the ArrayList? of Highways used in highways class, in sorted order. Stations are now implementing comparable to sort by postmile. writeHighwaysMeta() is an attempt at writing the highways meta data in condensed form, because loading time in NetworkLoader? is super long. We will eventually get rid of NetworkLoader? and do it within the Highways class for good OOP practice. There are new properties in atms_driver_properties.properties in config to support all these changes. Highway.java: new class, represents a highway which is a sorted ArrayList? of stations. This is a good checkpoint, for persistent green dots and all is working within the triangle. There is much commented out code in Highways.java which does not quite work. This commented code is an attempt at writing the condensed form highway meta data to improve loading times as described above.

File:
1 edited

Legend:

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

    r84 r87  
    2525    final private int lineInfo; 
    2626    final private long systemKey; 
    27     final private long globalSeq; 
    28     final private long scheduleSeq; 
     27    private long globalSeq; 
     28    private long scheduleSeq; 
    2929     
    3030    public FEPLine(int lineNum, List<Station> stations, int count, 
     
    4040        this.globalSeq = globalSeq; 
    4141        this.scheduleSeq = scheduleSeq; 
     42    } 
     43     
     44    // NEED TO CHECK NUMBERS? DO WE EVEN NEED THIS? 
     45    public void updateSequences() 
     46    {         
     47        this.scheduleSeq += 1; 
     48        this.globalSeq += 51; 
     49    } 
     50     
     51    public String getLineMeta() 
     52    { 
     53        StringBuilder build = new StringBuilder(); 
     54        build.append(Integer.toString(this.lineNum)); 
     55        build.append(" "); 
     56        build.append(Integer.toString(this.count)); 
     57        build.append(" "); 
     58        build.append(Integer.toString(this.stations.size())); 
     59        build.append("\n"); 
     60        for(Station station : stations) 
     61        { 
     62            build.append(station.getStationMeta()); 
     63        } 
     64        return build.toString(); 
    4265    } 
    4366     
Note: See TracChangeset for help on using the changeset viewer.