Logo Search packages:      
Sourcecode: gaffitter version File versions  Download package

int GeneticAlgorithm::Select ( int  a,
int  b,
int  p 
) const [inline, protected]

Select in [a,b] a random individual 'r' not equal 'p'.

Definition at line 220 of file GeneticAlgorithm.hh.

References Select().

   { 
      int r = Select(a,b);
      
      // equals?
      if (r==p) return r>a ? r-1 : a+1;

      return r; // Ok: 'b' not equal 'a'!
   }


Generated by  Doxygen 1.6.0   Back to index