Changeset 774 for cpp/frams/genetics/f4/oper_f4.cpp
- Timestamp:
- 04/11/18 01:16:08 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/genetics/f4/oper_f4.cpp
r773 r774 67 67 } 68 68 69 int Geno_f4::ValidateRec(f4_node * 69 int Geno_f4::ValidateRec(f4_node *geno, int retrycount) const 70 70 { 71 71 // ! the genotype is geno->child (not geno) ! … … 113 113 114 114 115 int Geno_f4::checkValidity(const char 115 int Geno_f4::checkValidity(const char* geno, const char *genoname) 116 116 { 117 117 f4_node root; … … 164 164 { 165 165 // make neuron 166 NeuroClass * 166 NeuroClass *rndclass = GenoOperators::getRandomNeuroClass(); 167 167 if (rndclass == NULL) 168 168 { … … 177 177 for (int i = 0; i < g->count(); i++) 178 178 { 179 f4_node * 180 char 181 NeuroClass * 179 f4_node *gcur = g->ordNode(i); 180 char* temp = (char*)gcur->name.c_str(); 181 NeuroClass *neuclass = GenoOperators::parseNeuroClass(temp); 182 182 if (neuclass != NULL) 183 183 { … … 215 215 { 216 216 // add link 217 f4_node * 218 char 219 NeuroClass * 217 f4_node *par = n1->parent; 218 char* temp = (char*)par->name.c_str(); 219 NeuroClass *neuclass = GenoOperators::parseNeuroClass(temp); 220 220 if (neuclass != NULL) 221 221 { … … 456 456 457 457 // change a [ node 458 void Geno_f4::linkNodeChangeRandom(f4_node * 458 void Geno_f4::linkNodeChangeRandom(f4_node *nn, int neuid, std::vector<NeuroClass*> neulist) const //rewritten by M.K. - should work as before (not tested) 459 459 { 460 460 double probs[3] = { 0.1, 0.3, 0.6 }; … … 495 495 496 496 // make a random : node 497 void Geno_f4::nparNodeMakeRandom(f4_node * 497 void Geno_f4::nparNodeMakeRandom(f4_node *nn) const 498 498 { 499 499 int sign = (int)(2.0f * rnd01); … … 505 505 506 506 // change a repeat # node 507 void Geno_f4::repeatNodeChangeRandom(f4_node * 507 void Geno_f4::repeatNodeChangeRandom(f4_node *nn) const 508 508 { 509 509 int count; … … 526 526 // ! the genotype is g->child (not g) ! 527 527 int i, res; 528 f4_node * 528 f4_node *gcopy = NULL; 529 529 // try this max 20 times: 530 530 // copy, mutate, then validate … … 600 600 601 601 // convert to tree 602 f4_node * 602 f4_node *root; 603 603 root = new f4_node(); 604 604 res = f4_processrec(g, 0, root); … … 654 654 655 655 656 int Geno_f4::CrossOverOne(f4_node * g1, f4_node *g2, float chg) const656 int Geno_f4::CrossOverOne(f4_node *g1, f4_node *g2, float chg) const 657 657 { 658 658 // ! the genotypes are g1->child and g2->child (not g1 g2) ! … … 660 660 int smin, smax; 661 661 float size; 662 f4_node * 662 f4_node *n1, *n2, *n1p, *n2p; 663 663 664 664 // determine desired size
Note: See TracChangeset
for help on using the changeset viewer.