Changeset 35
- Timestamp:
- 10/31/09 14:44:45 (15 years ago)
- Location:
- cpp/f8-to-f1
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/f8-to-f1/conv_f8tof1.cpp
r33 r35 27 27 using namespace std; 28 28 29 Lsystem::Lsystem() { 30 PrimitiveProduction *pp1 = new PrimitiveProduction(SString("X")); 31 this->primitiveProductions.insert(make_pair("X", pp1)); 32 PrimitiveProduction *pp2 = new PrimitiveProduction(SString("R")); 33 this->primitiveProductions.insert(make_pair("R", pp2)); 34 PrimitiveProduction *pp3 = new PrimitiveProduction(SString("r")); 35 this->primitiveProductions.insert(make_pair("r", pp3)); 36 PrimitiveProduction *pp4 = new PrimitiveProduction(SString("C")); 37 this->primitiveProductions.insert(make_pair("C", pp4)); 38 PrimitiveProduction *pp5 = new PrimitiveProduction(SString("c")); 39 this->primitiveProductions.insert(make_pair("c", pp5)); 40 PrimitiveProduction *pp6 = new PrimitiveProduction(SString("Q")); 41 this->primitiveProductions.insert(make_pair("Q", pp6)); 42 PrimitiveProduction *pp7 = new PrimitiveProduction(SString("q")); 43 this->primitiveProductions.insert(make_pair("q", pp7)); 44 PrimitiveProduction *pp8 = new PrimitiveProduction(SString("[")); 45 this->primitiveProductions.insert(make_pair("[", pp8)); 46 PrimitiveProduction *pp9 = new PrimitiveProduction(SString("]")); 47 this->primitiveProductions.insert(make_pair("]", pp9)); 48 PrimitiveProduction *pp10 = new PrimitiveProduction(SString("^")); 49 this->primitiveProductions.insert(make_pair("^", pp10)); 50 51 } 52 29 Lsystem::Lsystem() 30 { 31 for(int i=0;i<strlen(GenoConv_F8ToF1::simpleprods);i++) 32 { 33 string s(1,GenoConv_F8ToF1::simpleprods[i]); 34 SString ss(s.c_str()); 35 this->primitiveProductions.insert(make_pair(s, new PrimitiveProduction(ss))); 36 } 37 } 38 53 39 Lsystem::~Lsystem() { 54 for (map<string, Production*>::iterator iter = this->productions.begin(); 40 for (map<string, Production*>::iterator iter = this->productions.begin(); 55 41 iter != this->productions.end(); iter++) { 56 42 delete iter->second; 57 43 } 58 for (map<string, PrimitiveProduction*>::iterator iter = this->primitiveProductions.begin(); 44 for (map<string, PrimitiveProduction*>::iterator iter = this->primitiveProductions.begin(); 59 45 iter != this->primitiveProductions.end(); iter++) { 60 46 delete iter->second; … … 524 510 525 511 512 const char* GenoConv_F8ToF1::simpleprods="X[]^RrLlAaCcFfMmSsIiQqWw"; //Ee skipped 513 514 526 515 #define FIELDSTRUCT GenoConv_F8ToF1 527 516 -
cpp/f8-to-f1/conv_f8tof1.h
r33 r35 249 249 250 250 int maxF1Length; 251 static const char* simpleprods; 252 251 253 protected: 252 254 bool parseInput(const char* src, Lsystem* lsys); -
cpp/f8-to-f1/geno_f8.cpp
r34 r35 50 50 } 51 51 52 Geno_f8::Geno_f8() { 52 Geno_f8::Geno_f8() 53 { 53 54 supported_format = '8'; 54 this->simpleCommandLetters.push_back('X'); 55 this->simpleCommandLetters.push_back('R'); 56 this->simpleCommandLetters.push_back('r'); 57 this->simpleCommandLetters.push_back('C'); 58 this->simpleCommandLetters.push_back('c'); 59 this->simpleCommandLetters.push_back('Q'); 60 this->simpleCommandLetters.push_back('q'); 61 this->simpleCommandLetters.push_back('['); 62 this->simpleCommandLetters.push_back(']'); 63 this->simpleCommandLetters.push_back('^'); 55 56 for(int i=0;i<strlen(GenoConv_F8ToF1::simpleprods);i++) 57 this->simpleCommandLetters.push_back(GenoConv_F8ToF1::simpleprods[i]); 58 64 59 this->converter = new GenoConv_F8ToF1(); 65 60 … … 301 296 SString Geno_f8::mutateChangeArg(SString &in, float& chg) { 302 297 SString mutated; 303 298 304 299 Lsystem *newLsystem = this->converter->createLsystem(in); 305 300 if (newLsystem == NULL) { … … 1087 1082 1088 1083 #if GENO_F8_DEBUG > 0 1089 string mutationName = (method == 0) ? "F8_CHANGE_BEGINNING_ARG" : 1084 string mutationName = (method == 0) ? "F8_CHANGE_BEGINNING_ARG" : //TODO use mutation_method_names[] here 1090 1085 (method == 1) ? "F8_CHANGE_ARG" : 1091 1086 (method == 2) ? "F8_DELETE_COMMAND" :
Note: See TracChangeset
for help on using the changeset viewer.