Changeset 205 in tmcsimulator for trunk


Ignore:
Timestamp:
11/01/2017 03:53:59 AM (9 years ago)
Author:
jtorres
Message:

LoadHighwaysTest?.java: now passing. HighwaysParser?.cpp: added a bunch of debugging output to stdout, bug still not found. FEPSim.h: changed buffer size. FEPSim.cpp: some local debugging outputs/config.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/tmcsim/application.properties

    r202 r205  
    1 #Mon, 30 Oct 2017 19:17:39 -0700 
     1#Wed, 01 Nov 2017 05:01:19 -0700 
    22 
    3 Application.revision=195 
     3Application.revision=202 
    44 
    55Application.buildnumber=68 
  • trunk/test/atmsdriver/model/HighwaysTest.java

    r191 r205  
    5656    } 
    5757    String expString =  
    58  "241 ------------------------------------------------------------\n" 
    59 +"  5 @-------------------------------------------------------------------------------------------------------------------------------------------\n" 
    60 +"405 --------------------------------------------------------------------------------\n" 
    61 +"133 ----------------\n" 
    62 +"261 -----------------\n" 
    63 +" 22 ----------------------------------\n" 
    64 +" 55 ------------------------------------------\n" 
    65 +" 73 -----------------------------------------------------\n" 
    66 +" 57 ------------------------------------------\n" 
    67 +" 91 --------------------------------------------------------------\n" 
    68 +"605 ---\n"; 
     58        "241 ------------------------------------------------------------\n" 
     59       +"  5 @-------------------------------------------------------------------------------------------------------------------------------------------\n" 
     60       +"405 --------------------------------------------------------------------------------\n" 
     61       +"133 ----------------\n" 
     62       +"261 -----------------\n" 
     63       +" 22 ----------------------------------\n" 
     64       +" 55 ------------------------------------------\n" 
     65       +" 73 -----------------------------------------------------\n" 
     66       +" 57 ------------------------------------------\n" 
     67       +" 91 --------------------------------------------------------------\n" 
     68       +"605 ---\n"; 
    6969 
    7070    /** 
  • trunk/test/atmsdriver/model/LoadHighwaysTest.java

    r185 r205  
    2626            writer = new PrintWriter(new FileWriter("test/atmsdriver/model/lds_loadhighways_sample.txt")); 
    2727             
    28             writer.println("lds_id      line    drop sch lineinfo       system_key      sch_seq glo_seq         count   freeway Dir     ca_pm   lds_name"); 
    29             writer.println("1203081     6       17      2       2       1123005691      26491   1357639         19      55      N       4.58    BRISTOL"); 
    30             writer.println("1210163     6       20      2       2       1123005691      26491   1357639         19      55      N       5.51    PAULARINO 1"); 
    31             writer.println("1203244     50      4       13      13      1123005873      24148   1357650         19      55      N       10      MCFADDEN"); 
    32             writer.println("1203211     50      5       13      13      1123005873      24148   1357650         19      55      N       9.41    EDINGER 2"); 
    33              
    34             writer.println("1203261     23      14      23      21      1123005995      26479   1357626         18      55      S       10.4    S OF 5"); 
    35             writer.println("1203083     6       18      2       2       1123005691      26491   1357639         19      55      S       4.7     BAKER 1"); 
    36             writer.println("1210174     6       19      2       2       1123005691      26491   1357639         19      55      S       5.06    BAKER 2"); 
    37             writer.println("1203270     23      15      23      21      1123005995      26479   1357626         18      55      S       10.5    N OF 5"); 
    38              
    39             writer.println("1205238     22      16      4       4       1123005726      26490   1357624         19      5       S       32.25   17TH 1"); 
    40             writer.println("1205208     22      17      4       4       1123005726      26490   1357624         19      5       S       31.6    GRAND 1"); 
    41             writer.println("1205270     5       19      1       1       1123005673      26492   1357648         20      5       S       33      MAIN 1   "); 
    42              
    43  
     28            writer.println("2"); 
     29            writer.println("32 0 2"); 
     30            writer.println("1210831 1 5 S 0.9 8 CALAFIA"); 
     31            writer.println("1210832 ML_1"); 
     32            writer.println("1210833 ML_2"); 
     33            writer.println("1210834 ML_3"); 
     34            writer.println("1210835 ML_4"); 
     35            writer.println("1210836 PASSAGE"); 
     36            writer.println("1210837 DEMAND"); 
     37            writer.println("1210838 QUEUE"); 
     38            writer.println("1210839 RAMP_OFF"); 
     39            writer.println("1210845 2 5 S 1.49 9 EL CAMINO REAL"); 
     40            writer.println("1210846 ML_1"); 
     41            writer.println("1210847 ML_2"); 
     42            writer.println("1210848 ML_3"); 
     43            writer.println("1210849 ML_4"); 
     44            writer.println("1210850 RAMP_ON"); 
     45            writer.println("1210851 PASSAGE"); 
     46            writer.println("1210853 DEMAND"); 
     47            writer.println("1210854 QUEUE"); 
     48            writer.println("1210855 RAMP_OFF"); 
     49            writer.println("74 0 1"); 
     50            writer.println("1204203 2 5 N 1.26 13 MAGDALENA"); 
     51            writer.println("1204205 RAMP_ON"); 
     52            writer.println("1204206 QUEUE"); 
     53            writer.println("1204207 DEMAND"); 
     54            writer.println("1204208 PASSAGE"); 
     55            writer.println("1204210 RAMP_OFF"); 
     56            writer.println("1204212 ML_1"); 
     57            writer.println("1204213 ML_2"); 
     58            writer.println("1204214 ML_3"); 
     59            writer.println("1204215 ML_4"); 
     60            writer.println("1204217 OS_1"); 
     61            writer.println("1204218 OS_2"); 
     62            writer.println("1204219 OS_3"); 
     63            writer.println("1204220 OS_4"); 
    4464            writer.close(); 
    4565        } catch (Exception e) { 
     
    6181        System.out.println("toXML"); 
    6282        Highways highways = new Highways( 
    63                 "config/vds_data/highways_fullmap.txt", 
     83                "test/atmsdriver/model/lds_loadhighways_sample.txt", 
    6484                "localhost", 8080); 
    6585         
    6686        // Test for correct number of highways 
    6787        ArrayList<Highway> result = highways.highways; 
    68         assertEquals(2, result.size()); 
     88        assertEquals(1, result.size()); 
    6989         
    70         // Test 55 N was loaded 
    71         Highway fiftyfiveN = result.get(0); 
    72         assertEquals(new Integer(55), fiftyfiveN.routeNumber); 
     90        // Test 5 was loaded 
     91        Highway fiveS = result.get(0); 
     92        assertEquals(new Integer(5), fiveS.routeNumber); 
    7393         
    74         // Test 55 N stations are sorted by postmile 
    75         ArrayList<Station> stations = fiftyfiveN.stations; 
     94        // Test for correct number of stations 
     95        assertEquals(new Integer(3), new Integer(fiveS.stations.size())); 
     96         
     97        // Test 5 stations are sorted by postmile 
     98        ArrayList<Station> stations = fiveS.stations; 
    7699        ArrayList<Double> stationsPostmiles = new ArrayList<>(); 
    77100        for(Station station : stations) 
     
    82105        // Create expected station postmile list (sorted) 
    83106        ArrayList<Double> expectedStationsPostmiles = new ArrayList<>(); 
    84         expectedStationsPostmiles.add(new Double(4.58)); 
    85         expectedStationsPostmiles.add(new Double(4.7)); 
    86         expectedStationsPostmiles.add(new Double(5.06)); 
    87         expectedStationsPostmiles.add(new Double(5.51)); 
    88         expectedStationsPostmiles.add(new Double(9.41)); 
    89         expectedStationsPostmiles.add(new Double(10)); 
    90         expectedStationsPostmiles.add(new Double(10.4)); 
    91         expectedStationsPostmiles.add(new Double(10.5)); 
    92         for(int i = 0; i < 8; i++) 
    93         { 
    94             assertEquals(expectedStationsPostmiles.get(i),  
    95                     stationsPostmiles.get(i)); 
    96         } 
    97          
    98         // Test 55 S was loaded 
    99         Highway fiftyfiveS = result.get(1); 
    100         assertEquals(new Integer(5), fiftyfiveS.routeNumber); 
    101          
    102         // Test 55 S stations are sorted by postmile 
    103         stations = fiftyfiveS.stations; 
    104         stationsPostmiles.clear(); 
    105         for(Station station : stations) 
    106         { 
    107             stationsPostmiles.add(station.postmile); 
    108         } 
    109         expectedStationsPostmiles.clear(); 
    110         expectedStationsPostmiles.add(new Double(31.6)); 
    111         expectedStationsPostmiles.add(new Double(32.25)); 
    112         expectedStationsPostmiles.add(new Double(33)); 
     107        expectedStationsPostmiles.add(new Double(0.9)); 
     108        expectedStationsPostmiles.add(new Double(1.26)); 
     109        expectedStationsPostmiles.add(new Double(1.49)); 
     110 
    113111        for(int i = 0; i < 3; i++) 
    114112        { 
  • trunk/test/atmsdriver/model/LoadSadDotsTest.java

    r186 r205  
    4848        System.out.println("toXML"); 
    4949        Highways highways = new Highways( 
    50                 "config/vds_data/highways_fullmap.txt", 
     50                "test/atmsdriver/model/lds_loadhighways_sample.txt", 
    5151                "localhost", 8080); 
    5252         
Note: See TracChangeset for help on using the changeset viewer.