Changeset 1306 for framspy/evolalg/base


Ignore:
Timestamp:
05/13/24 03:59:10 (7 months ago)
Author:
Maciej Komosinski
Message:

Introduced symbolic names for dissimilarity estimation methods

File:
1 edited

Legend:

Unmodified
Added
Removed
  • framspy/evolalg/base/experiment_niching_abc.py

    r1304 r1306  
    1010from .experiment_abc import ExperimentABC
    1111from .remove_diagonal import remove_diagonal
     12from FramsticksLib import DissimMethod  # since the descendant ExperimentFramsNiching class does not introduce any Framsticks-specific dissimilarity methods, all of them must be known here (in ExperimentNiching)
    1213
    1314
     
    189190    def get_args_for_parser():
    190191        parser = ExperimentABC.get_args_for_parser()
    191         parser.add_argument("-dissim",type= int, default=1,
    192                    help="Dissimilarity measure type. Available: -3:freq, -2:dens, -1:Leven, 1:frams-struct (default}, 2:frams-descr")
     192        parser.add_argument("-dissim", type = lambda arg: DissimMethod[arg], choices = DissimMethod,
     193                   default=DissimMethod.PHENE_STRUCT_OPTIM,
     194                   help="Dissimilarity measure type. Available: " + str(DissimMethod._member_names_))
    193195        parser.add_argument("-fit",type= str, default="raw",
    194196                        help="Fitness type, availible types: niching, novelty, knn_niching (local), knn_novelty (local), nsga2, nslc and raw (default)")
Note: See TracChangeset for help on using the changeset viewer.