emat/model/core_files/gbnrtc_model.py
def archive(self, params: dict, model_results_path: str, experiment_id:int=0):
        """
        Copies TransCAD settings, outputs and common input files

        Args:
            params (dict): Dictionary of experiment variables
            model_results_path (str): archive path
            experiment_id (int, optional): The id number for this experiment.

        """
        
        _logger.info("Archiving model runs at {0}".format(time.strftime("%Y_%m_%d %H%M%S")))
        if self.tc is None:
            self.start_transcad()        

        # create output folder
        if not os.path.exists(model_results_path):
            os.makedirs(model_results_path)
            time.sleep(2)
            os.makedirs(os.path.join(model_results_path, "TAZ"))
            time.sleep(2)
            os.makedirs(os.path.join(model_results_path, "Network"))
            time.sleep(2)
            os.makedirs(os.path.join(model_results_path, "Inputs"))
            time.sleep(2)
            os.makedirs(os.path.join(model_results_path, "Inputs\\Model"))
            time.sleep(2)
            os.makedirs(os.path.join(model_results_path, "Outputs"))
            time.sleep(2)

        # record experiment definitions
        xl_df = pd.DataFrame(list(params.items()),columns=['variable','value'])
        xl_df.to_csv(model_results_path + '.csv')

        self.tc.RunMacro(
            "G30 File Close All",
            self.exp_param_ui)  # good idea incase TransCAD is holding any cards

        # copy model settings
        self.tc.RunMacro("Copy Model Parameters", self.exp_param_ui,
                         self.mod_path_tc +"\\\\",
                         model_results_path.replace("\\", "\\\\") + "\\\\")

        copy_model_outputs_ext(self.model_path, model_results_path, "AM_LinkVolumes")
        copy_model_outputs_ext(self.model_path, model_results_path, "PM_LinkVolumes")
        copy_model_outputs_ext(self.model_path, model_results_path, "MD_LinkVolumes")
        copy_model_outputs_ext(self.model_path, model_results_path, "NT_LinkVolumes")
        copy_model_outputs_ext(self.model_path, model_results_path, "TASN_ONO_pkwk")
        copy_model_outputs_ext(self.model_path, model_results_path, "TASN_ONO_opwk")
        copy_model_outputs_ext(self.model_path, model_results_path, "TASN_ONO_pkdr")
        copy_model_outputs_ext(self.model_path, model_results_path, "TASN_ONO_opdr")
        copy_model_outputs_ext(self.model_path, model_results_path, "pktrips")

        copy_model_outputs_1(self.model_path, model_results_path, "pkdr.mtx")
        copy_model_outputs_1(self.model_path, model_results_path, "pkwk.mtx")
        copy_model_outputs_1(self.model_path, model_results_path, "opdr.mtx")
        copy_model_outputs_1(self.model_path, model_results_path, "opwk.mtx")
        copy_model_outputs_1(self.model_path, model_results_path, "skim_walk.mtx")
        copy_model_outputs_1(self.model_path, model_results_path, "skim_hwypk.mtx")
        copy_model_outputs_1(self.model_path, model_results_path, "skim_hwyop.mtx")
        copy_model_outputs_1(self.model_path, model_results_path, "AM_hwytrips.mtx")
        copy_model_outputs_1(self.model_path, model_results_path, "PM_hwytrips.mtx")
        copy_model_outputs_1(self.model_path, model_results_path, "ModeChoice_Daily_Sum_Trips_pk.mtx")
        copy_model_outputs_1(self.model_path, model_results_path, "ModeChoice_Daily_Sum_Trips_op.mtx")
        copy_model_outputs_1(self.model_path, model_results_path, "msa_log.txt")
        
        # copy other files to support performance measures
        for file in glob.glob(
                os.path.join(
                    self.model_path,
                    "EMAExperimentFiles", "PerfMeasSupport", "*"
                )
        ):
            copy(file, os.path.join(model_results_path, 
                                    "EMAExperimentFiles", "PerfMeasSupport"))
            
        # copy output summaries (all csv's)
        for file in glob.glob(
                os.path.join(self.model_path, "Outputs", "*.csv")
        ):
            copy(file, os.path.join(model_results_path, "Outputs"))

        Copies TransCAD settings, outputs and common input files

        Args:
            params (dict): Dictionary of experiment variables
            model_results_path (str): archive path
            experiment_id (int, optional): The id number for this experiment.

        
Copies TransCAD settings, outputs and common input files
Copies TransCAD settings outputs and common input files
def archive(self, params: dict, model_results_path: str, experiment_id:int=0):
        _logger.info("Archiving model runs at {0}".format(time.strftime("%Y_%m_%d %H%M%S")))
        if self.tc is None:
            self.start_transcad()        
        if not os.path.exists(model_results_path):
            os.makedirs(model_results_path)
            time.sleep(2)
            os.makedirs(os.path.join(model_results_path, "TAZ"))
            time.sleep(2)
            os.makedirs(os.path.join(model_results_path, "Network"))
            time.sleep(2)
            os.makedirs(os.path.join(model_results_path, "Inputs"))
            time.sleep(2)
            os.makedirs(os.path.join(model_results_path, "Inputs\\Model"))
            time.sleep(2)
            os.makedirs(os.path.join(model_results_path, "Outputs"))
            time.sleep(2)
        xl_df = pd.DataFrame(list(params.items()),columns=['variable','value'])
        xl_df.to_csv(model_results_path + '.csv')
        self.tc.RunMacro(
            "G30 File Close All",
            self.exp_param_ui)  
        self.tc.RunMacro("Copy Model Parameters", self.exp_param_ui,
                         self.mod_path_tc +"\\\\",
                         model_results_path.replace("\\", "\\\\") + "\\\\")
        copy_model_outputs_ext(self.model_path, model_results_path, "AM_LinkVolumes")
        copy_model_outputs_ext(self.model_path, model_results_path, "PM_LinkVolumes")
        copy_model_outputs_ext(self.model_path, model_results_path, "MD_LinkVolumes")
        copy_model_outputs_ext(self.model_path, model_results_path, "NT_LinkVolumes")
        copy_model_outputs_ext(self.model_path, model_results_path, "TASN_ONO_pkwk")
        copy_model_outputs_ext(self.model_path, model_results_path, "TASN_ONO_opwk")
        copy_model_outputs_ext(self.model_path, model_results_path, "TASN_ONO_pkdr")
        copy_model_outputs_ext(self.model_path, model_results_path, "TASN_ONO_opdr")
        copy_model_outputs_ext(self.model_path, model_results_path, "pktrips")
        copy_model_outputs_1(self.model_path, model_results_path, "pkdr.mtx")
        copy_model_outputs_1(self.model_path, model_results_path, "pkwk.mtx")
        copy_model_outputs_1(self.model_path, model_results_path, "opdr.mtx")
        copy_model_outputs_1(self.model_path, model_results_path, "opwk.mtx")
        copy_model_outputs_1(self.model_path, model_results_path, "skim_walk.mtx")
        copy_model_outputs_1(self.model_path, model_results_path, "skim_hwypk.mtx")
        copy_model_outputs_1(self.model_path, model_results_path, "skim_hwyop.mtx")
        copy_model_outputs_1(self.model_path, model_results_path, "AM_hwytrips.mtx")
        copy_model_outputs_1(self.model_path, model_results_path, "PM_hwytrips.mtx")
        copy_model_outputs_1(self.model_path, model_results_path, "ModeChoice_Daily_Sum_Trips_pk.mtx")
        copy_model_outputs_1(self.model_path, model_results_path, "ModeChoice_Daily_Sum_Trips_op.mtx")
        copy_model_outputs_1(self.model_path, model_results_path, "msa_log.txt")
        for file in glob.glob(
                os.path.join(
                    self.model_path,
                    "EMAExperimentFiles", "PerfMeasSupport", "*"
                )
        ):
            copy(file, os.path.join(model_results_path, 
                                    "EMAExperimentFiles", "PerfMeasSupport"))
        for file in glob.glob(
                os.path.join(self.model_path, "Outputs", "*.csv")
        ):
            copy(file, os.path.join(model_results_path, "Outputs"))
def archive ( self , params : dict , model_results_path : str , experiment_id : int = 0 ) : _logger . info ( "Archiving model runs at {0}" . format ( time . strftime ( "%Y_%m_%d %H%M%S" ) ) ) if self . tc is None : self . start_transcad ( ) if not os . path . exists ( model_results_path ) : os . makedirs ( model_results_path ) time . sleep ( 2 ) os . makedirs ( os . path . join ( model_results_path , "TAZ" ) ) time . sleep ( 2 ) os . makedirs ( os . path . join ( model_results_path , "Network" ) ) time . sleep ( 2 ) os . makedirs ( os . path . join ( model_results_path , "Inputs" ) ) time . sleep ( 2 ) os . makedirs ( os . path . join ( model_results_path , "Inputs\\Model" ) ) time . sleep ( 2 ) os . makedirs ( os . path . join ( model_results_path , "Outputs" ) ) time . sleep ( 2 ) xl_df = pd . DataFrame ( list ( params . items ( ) ) , columns = [ 'variable' , 'value' ] ) xl_df . to_csv ( model_results_path + '.csv' ) self . tc . RunMacro ( "G30 File Close All" , self . exp_param_ui ) self . tc . RunMacro ( "Copy Model Parameters" , self . exp_param_ui , self . mod_path_tc + "\\\\" , model_results_path . replace ( "\\" , "\\\\" ) + "\\\\" ) copy_model_outputs_ext ( self . model_path , model_results_path , "AM_LinkVolumes" ) copy_model_outputs_ext ( self . model_path , model_results_path , "PM_LinkVolumes" ) copy_model_outputs_ext ( self . model_path , model_results_path , "MD_LinkVolumes" ) copy_model_outputs_ext ( self . model_path , model_results_path , "NT_LinkVolumes" ) copy_model_outputs_ext ( self . model_path , model_results_path , "TASN_ONO_pkwk" ) copy_model_outputs_ext ( self . model_path , model_results_path , "TASN_ONO_opwk" ) copy_model_outputs_ext ( self . model_path , model_results_path , "TASN_ONO_pkdr" ) copy_model_outputs_ext ( self . model_path , model_results_path , "TASN_ONO_opdr" ) copy_model_outputs_ext ( self . model_path , model_results_path , "pktrips" ) copy_model_outputs_1 ( self . model_path , model_results_path , "pkdr.mtx" ) copy_model_outputs_1 ( self . model_path , model_results_path , "pkwk.mtx" ) copy_model_outputs_1 ( self . model_path , model_results_path , "opdr.mtx" ) copy_model_outputs_1 ( self . model_path , model_results_path , "opwk.mtx" ) copy_model_outputs_1 ( self . model_path , model_results_path , "skim_walk.mtx" ) copy_model_outputs_1 ( self . model_path , model_results_path , "skim_hwypk.mtx" ) copy_model_outputs_1 ( self . model_path , model_results_path , "skim_hwyop.mtx" ) copy_model_outputs_1 ( self . model_path , model_results_path , "AM_hwytrips.mtx" ) copy_model_outputs_1 ( self . model_path , model_results_path , "PM_hwytrips.mtx" ) copy_model_outputs_1 ( self . model_path , model_results_path , "ModeChoice_Daily_Sum_Trips_pk.mtx" ) copy_model_outputs_1 ( self . model_path , model_results_path , "ModeChoice_Daily_Sum_Trips_op.mtx" ) copy_model_outputs_1 ( self . model_path , model_results_path , "msa_log.txt" ) for file in glob . glob ( os . path . join ( self . model_path , "EMAExperimentFiles" , "PerfMeasSupport" , "*" ) ) : copy ( file , os . path . join ( model_results_path , "EMAExperimentFiles" , "PerfMeasSupport" ) ) for file in glob . glob ( os . path . join ( self . model_path , "Outputs" , "*.csv" ) ) : copy ( file , os . path . join ( model_results_path , "Outputs" ) )
Copies TransCAD settings, outputs and common input files
Copies TransCAD settings outputs and common input files
"""
        Copies TransCAD settings, outputs and common input files

        Args:
            params (dict): Dictionary of experiment variables
            model_results_path (str): archive path
            experiment_id (int, optional): The id number for this experiment.

        """ # create output folder # record experiment definitions # good idea incase TransCAD is holding any cards # copy model settings # copy other files to support performance measures # copy output summaries (all csv's)
self
params
dict
Dictionary of experiment variables
Dictionary of experiment variables
model_results_path
str
None
experiment_id
int
The id number for this experiment.
The id number for this experiment .