Ignore:
Timestamp:
07/09/20 00:13:20 (4 years ago)
Author:
Maciej Komosinski
Message:

Building a Model from Geno now fails when Model.shape is incompatible with Geno.format; renamed enum constants for genetic formats: xxx_FORMAT => FORMAT_xxx

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/geno.cpp

    r972 r988  
    3838}
    3939
    40 const SString Geno::INVALID_FORMAT = "invalid";
    41 const SString Geno::UNKNOWN_FORMAT = "";
     40const SString Geno::FORMAT_INVALID = "invalid";
     41const SString Geno::FORMAT_UNKNOWN = "";
    4242const SString Geno::F0_FORMAT_LIST = "0,0s";
    4343
     
    6868        SString format = trim(input);
    6969        if (format.length() == 0 || strContainsOneOf(format.c_str(), " \r\n\t"))
    70                 return Geno::INVALID_FORMAT;
     70                return Geno::FORMAT_INVALID;
    7171        return format;
    7272}
     
    7878        SString gencopy(genstring);
    7979        SString genformat = in_genformat;
    80         if (genformat == UNKNOWN_FORMAT)
     80        if (genformat == FORMAT_UNKNOWN)
    8181        { // unknown format
    8282                genformat = "1";
     
    118118                                break;
    119119                        }
    120                         if (genformat == INVALID_FORMAT)
     120                        if (genformat == FORMAT_INVALID)
    121121                        {
    122122                                SString cut;
     
    191191Geno::Geno(const SString& src)
    192192{
    193         init(src, UNKNOWN_FORMAT, SString::empty(), SString::empty());
     193        init(src, FORMAT_UNKNOWN, SString::empty(), SString::empty());
    194194}
    195195
     
    204204{
    205205        freeF0();
    206         init(g, UNKNOWN_FORMAT, SString::empty(), SString::empty());
     206        init(g, FORMAT_UNKNOWN, SString::empty(), SString::empty());
    207207}
    208208
     
    277277        if (isvalid >= 0) return;
    278278        if (gen.length() == 0) { isvalid = 0; return; }
    279         if (format == INVALID_FORMAT) { isvalid = 0; return; }
     279        if (format == FORMAT_INVALID) { isvalid = 0; return; }
    280280        Validators* vals = getValidators();
    281281        if (vals != NULL)
Note: See TracChangeset for help on using the changeset viewer.