Ignore:
Timestamp:
04/09/15 23:51:28 (9 years ago)
Author:
Maciej Komosinski
Message:
  • explicit c_str() in SString instead of (const char*) cast
  • genetic converters and GenMan? are now thread-local which enables multi-threaded simulator separation
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/preconfigured.h

    r346 r348  
    1818DefaultGenoConvManager gcm;
    1919GenMan genman;
     20Geno::Validators validators;
    2021ModelGenoValidator model_validator; //validation through conversion
    2122
     
    2324        {
    2425        gcm.addDefaultConverters(); //without converters, the application would only handle "format 0" genotypes
    25         Geno::useConverters(gcm);
     26        Geno::useConverters(&gcm);
    2627
    27         Geno::addValidator(&genman); //primary validation: use the extended validity checking (through dedicated genetic operators)
    28         Geno::addValidator(&model_validator); //secondary validation: this simple validator handles all cases when there is no dedicated genetic validation operator, but a converter for a particular format is available. Converters may be less strict in detecting invalid genotypes but using them and checking whether they produced a valid f0 genotype is also some way to tell whether the initial genotype was valid. Otherwise, without dedicated genetic validation operator, we would have no validity check at all.
    29         }
    30 };
    31 
    32 /** Initialization procedure for applications adding their own validators */
    33 class PreconfiguredGenetics_NoValidators
    34 {
    35   public:
    36 DefaultGenoConvManager gcm;
    37 
    38 PreconfiguredGenetics_NoValidators()
    39         {
    40         gcm.addDefaultConverters(); //without converters, the application would only handle "format 0" genotypes
    41         Geno::useConverters(gcm);
     28        Geno::useValidators(&validators);
     29        validators+=&genman; //primary validation: use the extended validity checking (through dedicated genetic operators)
     30        validators+=&model_validator; //secondary validation: this simple validator handles all cases when there is no dedicated genetic validation operator, but a converter for a particular format is available. Converters may be less strict in detecting invalid genotypes but using them and checking whether they produced a valid f0 genotype is also some way to tell whether the initial genotype was valid. Otherwise, without dedicated genetic validation operator, we would have no validity check at all.
    4231        }
    4332};
    4433
    4534#endif
    46 
Note: See TracChangeset for help on using the changeset viewer.