本文整理汇总了C++中Objective::getObjectiveValue方法的典型用法代码示例。如果您正苦于以下问题:C++ Objective::getObjectiveValue方法的具体用法?C++ Objective::getObjectiveValue怎么用?C++ Objective::getObjectiveValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Objective
的用法示例。
在下文中一共展示了Objective::getObjectiveValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: evaluateObjectives
returnValue MultiObjectiveAlgorithm::evaluateObjectives( VariablesGrid &xd_ ,
VariablesGrid &xa_ ,
VariablesGrid &p_ ,
VariablesGrid &u_ ,
VariablesGrid &w_ ,
Expression **arg ){
int run1;
Grid tmp_grid;
ocp->getGrid( tmp_grid );
VariablesGrid *_xd = 0;
VariablesGrid *_xa = 0;
VariablesGrid *_p = 0;
VariablesGrid *_u = 0;
VariablesGrid *_w = 0;
if( xd_.isEmpty() == BT_FALSE ) _xd = new VariablesGrid(xd_);
if( xa_.isEmpty() == BT_FALSE ) _xa = new VariablesGrid(xa_);
if( p_.isEmpty() == BT_FALSE ) _p = new VariablesGrid(p_ );
if( u_.isEmpty() == BT_FALSE ) _u = new VariablesGrid(u_ );
if( w_.isEmpty() == BT_FALSE ) _w = new VariablesGrid(w_ );
Objective *obj;
for( run1 = 0; run1 < m; run1++ ){
obj = new Objective( tmp_grid );
obj->addMayerTerm(*arg[run1]);
OCPiterate xx( _xd, _xa, _p, _u, _w );
obj->evaluate( xx );
obj->getObjectiveValue( result(count,run1) );
delete obj;
}
count++;
if( _xd != 0 ) delete _xd;
if( _xa != 0 ) delete _xa;
if( _p != 0 ) delete _p ;
if( _u != 0 ) delete _u ;
if( _w != 0 ) delete _w ;
return SUCCESSFUL_RETURN;
}