Esempio n. 1
0
/*--------------------------------------------------------*/
bool NOMAD::Pareto_Point::operator <
( const NOMAD::Set_Element<NOMAD::Eval_Point> & fp ) const
{
  if ( this == &fp || get_element() == fp.get_element() )
    return false;
  
  int i1 = NOMAD::Multi_Obj_Evaluator::get_i1();

  return get_element()->get_bb_outputs()[i1].value() <
         fp.get_element()->get_bb_outputs()[i1].value();
}
Esempio n. 2
0
 /**
    \param se The right-hand side object -- \b IN.
 */
 virtual bool operator < (const NOMAD::Set_Element<NOMAD::Signature> &se) const
 {
     return (*get_element() < *(se.get_element()));
 }
Esempio n. 3
0
 /**
    \param  fp The right-hand side object.
    \return A boolean equal to \c true if \c *this \c < \c fp.
 */
 virtual bool operator < ( const NOMAD::Set_Element<NOMAD::Eval_Point> & fp ) const
 {
   return get_element()->get_h().value() < fp.get_element()->get_h().value();
 }
/*------------------------------------------------*/
bool NOMAD::Priority_Eval_Point::dominates
( const NOMAD::Set_Element<NOMAD::Eval_Point> & x ) const
{
    if ( this == &x )
        return false;
    const NOMAD::Eval_Point * x1 = get_element();
    const NOMAD::Eval_Point * x2 = x.get_element();

    // criterion 0: lexicographic order
    if (_lexicographic_order)
        return NOMAD::Point(*x1) < NOMAD::Point(*x2);


    // criterion 1: user criterion:
    // ------------
    const NOMAD::Double uep1 = x1->get_user_eval_priority();
    if ( uep1.is_defined() )
    {
        const NOMAD::Double uep2 = x2->get_user_eval_priority();
        if ( uep2.is_defined() )
        {
            if ( uep1 > uep2 )
                return true;
            if ( uep2 > uep1 )
                return false;
        }
    }

    // specific Priority_Eval_Point elements of comparison:
    NOMAD::Double x_f_sgte;
    NOMAD::Double x_h_sgte;
    NOMAD::Double x_f_model;
    NOMAD::Double x_h_model;
    NOMAD::Double x_angle_success_dir;
    NOMAD::Double x_angle_simplex_grad;

    x.get_priority_criteria ( x_f_sgte             ,
                              x_h_sgte             ,
                              x_f_model            ,
                              x_h_model            ,
                              x_angle_success_dir  ,
                              x_angle_simplex_grad   );

    // criterion 2: give priority to already evaluated cache points:
    // ------------
    if ( x1->is_in_cache() && !x2->is_in_cache() )
        return true;
    if ( x2->is_in_cache() && !x1->is_in_cache() )
        return false;

    // criterion 3: give priority to already evaluated points
    // ------------ that are eval_ok:
    if ( x1->is_eval_ok() && !x2->is_eval_ok() )
        return true;
    if ( x2->is_eval_ok() && !x1->is_eval_ok() )
        return false;

    // criterion 4: true f and h values:
    // -----------
    int flag = compare_hf_values ( x1->get_h() ,
                                   x1->get_f() ,
                                   x2->get_h() ,
                                   x2->get_f()   );
    if ( flag )
        return ( flag > 0 );

    // criterion 5: surrogate f and h values:
    // ------------
    flag = compare_hf_values ( _h_sgte , _f_sgte , x_h_sgte , x_f_sgte );
    if ( flag )
        return ( flag > 0 );

    // criterion 6: model f and h values:
    // ------------
    flag = compare_hf_values ( _h_model , _f_model , x_h_model , x_f_model );
    if ( flag )
        return ( flag > 0 );



    // criterion 7: check the angle with the last successful direction:
    // ------------
    if ( _angle_success_dir.is_defined() && x_angle_success_dir.is_defined() )
    {
        if ( _angle_success_dir < x_angle_success_dir )
            return true;
        if ( x_angle_success_dir < _angle_success_dir )
            return false;
    }


    // criterion 8: take the point with the best h value:
    // ------------
    flag = compare_h_values ( x1->get_h() , x2->get_h() );
    if ( flag )
        return ( flag > 0 );

    flag = compare_h_values ( _h_sgte , x_h_sgte );
    if ( flag )
        return ( flag > 0 );

    flag = compare_h_values ( _h_model , x_h_model );
    if ( flag )
        return ( flag > 0 );

    // criterion 9: random criterion for randomly generated directions:
    // -------------
    const NOMAD::Double rep1 = x1->get_rand_eval_priority();
    if ( rep1.is_defined() )
    {
        const NOMAD::Double rep2 = x2->get_rand_eval_priority();
        if ( rep2.is_defined() )
        {
            if ( rep1 < rep2 )
                return true;
            if ( rep2 < rep1 )
                return false;
        }
    }

    // criterion 10: compare the tags:
    // -------------
    return x1->get_tag() < x2->get_tag();

}