Changeset 955 for cpp/frams/genetics/geno.h
- Timestamp:
- 06/25/20 00:34:29 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/genetics/geno.h
r732 r955 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-20 18Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2020 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 34 34 SString gen; 35 35 SString name; 36 charformat;36 SString format; 37 37 SString txt; 38 38 int isvalid; ///< <0 -> unknown >=0 -> value for "isValid" … … 44 44 int multiline; 45 45 46 void init(const SString& genstring, c hargenformat, const SString& genname, const SString& comment);46 void init(const SString& genstring, const SString& genformat, const SString& genname, const SString& comment); 47 47 void validate(void); 48 48 … … 55 55 56 56 public: 57 static const char INVALID_FORMAT = '!'; 57 static const SString INVALID_FORMAT; 58 static const SString UNKNOWN_FORMAT; 58 59 typedef SListTempl<GenoValidator*> Validators; 59 60 … … 62 63 /// @param genformat genotype format 63 64 /// @param comment information about genotype (for genetic operators and "history") 64 Geno(const char *genstring = 0, char genformat = -1, const char *genname = 0, const char *comment = 0); 65 Geno(const char *genstring = 0, const char* genformat = 0, const char *genname = 0, const char *comment = 0); 66 67 Geno(const char *genstring, char genformat, const char *genname = 0, const char *comment = 0); //old style Geno, accepts char genoformat 65 68 66 69 /// create a genotype object from primitives … … 69 72 /// @param name genotype name, new name will generated if needed 70 73 /// @param comment information about genotype (for genetic operators and "history") 71 Geno(const SString& genstring, c hargenformat, const SString& genname, const SString& comment);74 Geno(const SString& genstring, const SString& genformat, const SString& genname, const SString& comment); 72 75 73 76 /// create object from full string, containing optional format and comment information … … 89 92 void setString(const SString& genewithcomments); 90 93 91 /** @param genformat= -1-> detect genotype format from genstring comment (like the constructor does), else specify the valid format in genformat and pure genes in genstring. */92 void setGenesAndFormat(const SString& genstring, c har genformat = -1);94 /** @param genformat="" -> detect genotype format from genstring comment (like the constructor does), else specify the valid format in genformat and pure genes in genstring. */ 95 void setGenesAndFormat(const SString& genstring, const SString& genformat = UNKNOWN_FORMAT); 93 96 /** g must be pure genes, without format. For the standard behavior use setGenesAndFormat() */ 94 97 void setGenesAssumingSameFormat(const SString& g); … … 97 100 SString getName(void) const; 98 101 void setName(const SString&); 99 chargetFormat(void) const;102 SString getFormat(void) const; 100 103 101 104 SString getComment(void) const; … … 107 110 /// make converted version of the genotype. 108 111 /// @param converter_missing optional output parameter (ignored when NULL). Receives true if the conversion fails because of the lack of appropriate converter(s) (the returned Geno is always invalid in this case). Receives false if the genotype was converted by a converter or a converter chain (the returned Geno can be valid or invalid, depending on the converter's decision). 109 Geno getConverted( charotherformat, MultiMap *m = 0, bool using_checkpoints = false, bool *converter_missing = NULL);112 Geno getConverted(SString otherformat, MultiMap *m = 0, bool using_checkpoints = false, bool *converter_missing = NULL); 110 113 111 114 /// @return -1 = before first char in the string
Note: See TracChangeset
for help on using the changeset viewer.