Ignore:
Timestamp:
09/25/21 01:02:06 (15 months ago)
Author:
Maciej Komosinski
Message:

Added support for loading multiple .sim files where each can overwrite selected settings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • framspy/FramsticksLib.py

    r1119 r1149  
    2424
    2525        GENOTYPE_INVALID = "/*invalid*/"  # this is how genotype invalidity is represented in Framsticks
    26         EVALUATION_SETTINGS_FILE = "eval-allcriteria.sim"  # MUST be compatible with the standard-eval expdef
     26        EVALUATION_SETTINGS_FILE = [  # all files MUST be compatible with the standard-eval expdef. The order they are loaded in is important!
     27                "eval-allcriteria.sim",  # a good trade-off in performance sampling period ("perfperiod") for vertpos and velocity
     28                # "deterministic.sim",  # turns off random noise (added for robustness) so that each evaluation yields identical performance values (causes "overfitting")
     29                # "sample-period-2.sim", # short performance sampling period so performance (e.g. vertical position) is sampled more often
     30                # "sample-period-longest.sim",  # increased performance sampling period so distance and velocity are measured rectilinearly
     31        ]
    2732
    2833
     
    3540        #       return frams
    3641
    37         def __init__(self, frams_path, frams_lib_name, simsettings):
     42        def __init__(self, frams_path, frams_lib_name, sim_settings_files):
    3843                if frams_lib_name is None:
    3944                        frams.init(frams_path)  # could add support for setting alternative directories using -D and -d
     
    5459                        frams.Math.randomize();
    5560                frams.Simulator.expdef = "standard-eval"  # this expdef (or fully compatible) must be used by EVALUATION_SETTINGS_FILE
    56                 if simsettings is not None:
    57                         self.EVALUATION_SETTINGS_FILE = simsettings
    58                 frams.Simulator.ximport(self.EVALUATION_SETTINGS_FILE, 4 + 8 + 16)
     61                if sim_settings_files is not None:
     62                        self.EVALUATION_SETTINGS_FILE = sim_settings_files
     63                print('Using settings:', self.EVALUATION_SETTINGS_FILE)
     64                assert isinstance(self.EVALUATION_SETTINGS_FILE, list)  # ensure settings file(s) are provided as a list
     65                for simfile in self.EVALUATION_SETTINGS_FILE:
     66                        frams.Simulator.ximport(simfile, 4 + 8 + 16)
    5967
    6068
Note: See TracChangeset for help on using the changeset viewer.