Ignore:
Timestamp:
06/23/2019 10:27:35 AM (7 years ago)
Author:
jdalbey
Message:

Remove ATMS functionality. Reworked and simplified the Highway model to use only VDS data from PeMS. Updated all unit tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/tmcsim/cadsimulator/managers/TrafficModelManager.java

    r407 r422  
    22 
    33import atmsdriver.GoogleMapAnimator; 
    4 import atmsdriver.model.Highways; 
    5 import atmsdriver.model.LoopDetector; 
    6 import atmsdriver.model.TrafficEvent; 
     4import tmcsim.highwaymodel.Highways; 
     5import tmcsim.highwaymodel.LoopDetector; 
     6import tmcsim.highwaymodel.TrafficEvent; 
    77import java.awt.event.ActionEvent; 
    88import java.awt.event.ActionListener; 
     
    129129            incidents = new HashMap<String, List<TrafficEvent>>(); 
    130130            highways = new Highways( 
    131                     props.getProperty(PROPERTIES.HIGHWAYS_MAP_FILE.name), 
    132                     props.getProperty(PROPERTIES.FEPSIM_IP_ADDR.name), 
    133                     8080);  
     131                    props.getProperty(PROPERTIES.HIGHWAYS_MAP_FILE.name));  
    134132            this.theCoordinator = theCoordinator; 
    135133        } 
     
    211209        timer.start(); 
    212210 
    213         if (props.getProperty(PROPERTIES.OUTPUT_DEST.name).equals("FEP")) 
    214         { 
    215             // Start the FEP thread (to update ATMS every 30 sec). (See class def below) 
    216             Thread wtfep = new WriteToFEPThread(); 
    217             wtfep.start(); 
    218         } 
    219         else 
    220         { 
    221             Thread wtConsole = new WriteToConsoleThread(); 
    222             wtConsole.start(); 
    223         } 
    224211        // Always write to json for google map display 
    225212        Thread wtJson = new WriteToJsonThread(); 
     
    411398    } 
    412399 
    413     class WriteToConsoleThread extends Thread 
    414     { 
    415  
    416         public void run() 
    417         { 
    418             System.out.println("WriteToConsole Thread starting."); 
    419             // Run indefinitely 
    420             while (true) 
    421             { 
    422                  // Write the highway network status to the Console 
    423                  System.out.println(highways.toString()); 
    424                 // Pause the thread 
    425                 try 
    426                 { 
    427                     Thread.sleep(10000); 
    428                 } 
    429                 catch (InterruptedException ie) 
    430                 { 
    431                     ie.printStackTrace(); 
    432                 } 
    433             } 
    434  
    435         } 
    436     } 
    437400    /** Writes the highway model to a GeoJson file for reading 
    438401     *  by Google Maps. 
     
    475438    } 
    476439     
    477     class WriteToFEPThread extends Thread 
    478     { 
    479  
    480         public void run() 
    481         { 
    482             System.out.println("WriteToFEP Thread starting."); 
    483             // Run indefinitely 
    484             boolean running = true; 
    485             while (running) 
    486             { 
    487                 try 
    488                 { 
    489                     // Write the highway network status to the FEP Simulator 
    490                     highways.writeToFEP(); 
    491                 } 
    492                 catch (SimulationException ex) 
    493                 { 
    494                     // Ask user if they want to proceed without FEP Sim connection 
    495 //                    int reply = JOptionPane.showConfirmDialog(null, "Failed to connect to FEP Sim, proceed anyway?", "Network Failure", JOptionPane.YES_NO_OPTION); 
    496 //                    if (reply == JOptionPane.NO_OPTION) 
    497 //                    { 
    498 //                        System.exit(0); 
    499 //                    } 
    500                     System.out.println("Skipping writeToFEP..."); 
    501                     running = false; 
    502                 } 
    503  
    504                 // Wait for FEP Sim to process the data we just sent 
    505                 try 
    506                 { 
    507                     Thread.sleep(FEPSIM_INTERVAL); 
    508                 } 
    509                 catch (InterruptedException ie) 
    510                 { 
    511                     ie.printStackTrace(); 
    512                 } 
    513             } 
    514  
    515         } 
    516     } 
     440     
    517441} 
Note: See TracChangeset for help on using the changeset viewer.