Exemplo n.º 1
0
/**
* Executes the operation
* @param object An object containing an array of two parents
* @return An object containing the offSprings
*/
void * SBXCrossover::execute(void *object) {

//  double probability = *(double *)getParameter("probability");
    
  Solution ** parents = (Solution **) object;
  // TODO: Comprobar la longitud de parents
  // TODO: Chequear el tipo de parents

  Solution ** offSpring = (Solution **)doCrossover(crossoverProbability_, parents[0], parents[1]);
            
//  for (int i = 0; i < 2; i++) // this operator will return only 2 offpsrings
//  {
//    offSpring[i]->setCrowdingDistance(0.0);
//    offSpring[i]->setRank(0);
//  }

  return offSpring;
} // execute 
Exemplo n.º 2
0
/**
 * Executes the operation
 * @param object An object containing an array of two parents
 * @return An object containing the offSprings
 */
void *TTPCrossover::execute(void *object) {
    Solution **parents = (Solution **) object;
    Solution **offSpring = (Solution **) doCrossover(crossoverProbability_, parents[0], parents[1]);
    return offSpring;
} // execute