mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
2.7 KiB

  1. --- ./src/Problem.hpp.orig 2005-03-04 10:28:03.429496128 +0100
  2. +++ ./src/Problem.hpp 2005-03-04 10:31:32.006787560 +0100
  3. @@ -306,14 +306,14 @@
  4. virtual G Goal_Value(T *a)
  5. {
  6. if (depth==0)
  7. - return tester->Goal_Value(a);
  8. + return this->tester->Goal_Value(a);
  9. - Goal_Test<G,T> *endtester=tester;
  10. - tester=new Minimax_Goal_Test(depth-1,generator,other_acc,goal_acc,tester);
  11. + Goal_Test<G,T> *endtester=this->tester;
  12. + this->tester=new Minimax_Goal_Test(depth-1,this->generator,other_acc,this->goal_acc,this->tester);
  13. G ret_val=Successor_Goal_Test<G,T>::Goal_Value(a);
  14. - delete tester;
  15. - tester=endtester;
  16. - delete next;
  17. + delete this->tester;
  18. + this->tester=endtester;
  19. + delete this->next;
  20. return ret_val;
  21. }
  22. @@ -340,19 +340,19 @@
  23. virtual G Goal_Value(T *a)
  24. {
  25. - Goal_Accumulator <G,T> *old=goal_acc;
  26. + Goal_Accumulator <G,T> *old=this->goal_acc;
  27. Multi_Goal_Accumulator <G,T,greater<G> > *mga=new Multi_Goal_Accumulator<G,T,greater<G> >(branch);
  28. - goal_acc=mga;
  29. + this->goal_acc=mga;
  30. Successor_Goal_Test<G,T>::Goal_Value(a);
  31. - goal_acc=old;
  32. + this->goal_acc=old;
  33. for (mga->Init();!mga->IsEnd();mga->Next()) {
  34. T *state=mga->Get_State();
  35. - Multi_Minimax_Goal_Test *next=new Multi_Minimax_Goal_Test(d-1,b,gen,other,goal_acc,tester);
  36. + Multi_Minimax_Goal_Test *next=new Multi_Minimax_Goal_Test(this->d-1,this->b,this->gen,other,this->goal_acc,this->tester);
  37. next->Goal_Value(state);
  38. - goal_acc->Put(accumulator->value,acc->state,acc->op);
  39. + this->goal_acc->Put(this->accumulator->value,this->acc->state,this->acc->op);
  40. }
  41. - goal_acc->Put(mga->Get_State(),mga->Get_Operator(),mga->Get_Result());
  42. - return goal_acc->Get_Value();
  43. + this->goal_acc->Put(mga->Get_State(),mga->Get_Operator(),mga->Get_Result());
  44. + return this->goal_acc->Get_Value();
  45. }
  46. };
  47. --- ./src/Genetic.hpp.orig 2005-03-04 10:32:17.605855448 +0100
  48. +++ ./src/Genetic.hpp 2005-03-04 10:40:23.161039840 +0100
  49. @@ -216,9 +216,9 @@
  50. virtual Genetic_Operator<T> *Choose_Operator(void)
  51. {
  52. int max=(int)total_op_weight;
  53. - list<Genetic_Operator<T> *>::iterator start=operators.begin();
  54. - list<Genetic_Operator<T> *>::iterator end=operators.end();
  55. - list<Genetic_Operator<T> *>::iterator iter;
  56. + typename list<Genetic_Operator<T> *>::iterator start=operators.begin();
  57. + typename list<Genetic_Operator<T> *>::iterator end=operators.end();
  58. + typename list<Genetic_Operator<T> *>::iterator iter;
  59. int r=rand()%max;
  60. int count=0;
  61. for (iter=start;iter!=end;iter++) {
  62. @@ -264,7 +264,7 @@
  63. cur_size++;
  64. }
  65. }
  66. - newpop->Eval_Fitness(fit_func);
  67. + newpop->Eval_Fitness(this->fit_func);
  68. return newpop;
  69. }