Changeset 258 in tmcsimulator for trunk/src/tmcsim/cadsimulator


Ignore:
Timestamp:
02/11/2019 03:36:49 PM (7 years ago)
Author:
jdalbey
Message:

TrafficModelManager?: update to read json output destination from properties file.

File:
1 edited

Legend:

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

    r248 r258  
    6363        FEPSIM_IP_ADDR("FEPSim_IP_addr"), 
    6464        EVENTS_FILE("Events_File"), 
    65         OUTPUT_DEST("Output_Destination"); 
     65        OUTPUT_DEST("Output_Destination"), 
     66        JSON_PATH("Json_Path"); 
    6667         
    6768        public String name; 
     
    102103     */ 
    103104    private String currentClock = ""; 
    104        
     105     
     106    /** 
     107     * Path for writing highway data to Json file. 
     108     */ 
     109    private String jsonPath; 
     110     
    105111    /** 
    106112     * Constructor. Loads the Properties file and initializes the 
     
    117123        { 
    118124            props = loadProperties(propertiesFile); 
     125            jsonPath = props.getProperty(PROPERTIES.JSON_PATH.name); 
     126            logger.logp(Level.INFO, "Traffic Managr", "Constructor",  
     127                    "Highway network json output: " + jsonPath); 
    119128            // Initialize the highway model 
    120129            incidents = new HashMap<String, List<TrafficEvent>>(); 
     
    455464                { 
    456465                    // currently writes to local file 
    457                     out = new PrintWriter("highways.json"); 
     466                    out = new PrintWriter(jsonPath); 
    458467                    out.print(geojson); 
    459468                    out.close(); 
Note: See TracChangeset for help on using the changeset viewer.