Ejemplo n.º 1
0
ColumnVector NLF1::evalLagrangianGradient(const ColumnVector& xc, 
                                          const ColumnVector& multiplier,
					  const ColumnVector& type) 
{
   ColumnVector grad  = evalG(xc);
   if(hasConstraints()){
      ColumnVector tmult = -multiplier;
      grad += constraint_->evalGradient(xc)*tmult;
   }
   return grad;
}
Ejemplo n.º 2
0
/**
 * Evaluates a solution
 * @param solution The solution to evaluate
 */
void ZDT1::evaluate(Solution *solution) {
	XReal * x = new XReal(solution);

	fx_[0] = x->getValue(0) ;
  double g = evalG(x) ;
  double h = evalH(fx_[0], g) ;
	fx_[1] = h * g ;

	solution->setObjective(0,fx_[0]);
	solution->setObjective(1,fx_[1]);

	delete x ;
} // evaluate
Ejemplo n.º 3
0
/**
 * Evaluates a solution
 * @param solution The solution to evaluate
 */
void ZDT6::evaluate(Solution *solution) {
    XReal * x = new XReal(solution);

    double x1 = x->getValue(0) ;
    fx_[0] = 1.0 - exp(-4.0*x1) * pow(sin(6.0*PI*x1), 6.0) ;
    double g = evalG(x) ;
    double h = evalH(fx_[0], g) ;
    fx_[1] = h * g ;

    solution->setObjective(0,fx_[0]);
    solution->setObjective(1,fx_[1]);

    delete x ;
} // evaluate
Ejemplo n.º 4
0
/**
 * Evaluates a solution
 * @param solution The solution to evaluate
 */
void ZDT5::evaluate(Solution *solution) {
  Binary * variable ;
  int    counter  ;

  variable = (Binary *)(solution->getDecisionVariables()[0]) ;

  fx_[0]        = 1 + variable->cardinality();

  double g    = evalG(solution)  ;
  double h    = evalH(fx_[0],g)  ;
  fx_[1]        = h * g          ;

  solution->setObjective(0,fx_[0]);
  solution->setObjective(1,fx_[1]);


} // evaluate
Ejemplo n.º 5
0
 objectives eval(const variables vars) {
     double g = evalG(vars);
     double h = evalH(vars[0], g);
     return objectives{vars[0], g * h};
 }