Updating names: SharedDataFunction::d => SharedDataFunction::_data, ParallelApplyData::_data => ParallelApplyData::_table

This commit is contained in:
Benjamin Bouvier 2012-07-18 17:37:50 +02:00
commit eebeaa810e
4 changed files with 44 additions and 41 deletions

View file

@ -138,6 +138,7 @@ struct CatBestAnswers : public eo::mpi::HandleResponseParallelApply<EOT>
void operator()(int wrkRank)
{
eo::mpi::ParallelApplyData<EOT> * d = _data;
// Retrieve informations about the slice processed by the worker
int index = d->assignedTasks[wrkRank].index;
int size = d->assignedTasks[wrkRank].size;
@ -146,10 +147,10 @@ struct CatBestAnswers : public eo::mpi::HandleResponseParallelApply<EOT>
// Compare fitnesses of evaluated individuals with the best saved
for(int i = index; i < index+size; ++i)
{
if( best.fitness() < d->data()[ i ].fitness() )
if( best.fitness() < d->table()[ i ].fitness() )
{
eo::log << eo::quiet << "Better solution found:" << d->data()[i].fitness() << std::endl;
best = d->data()[ i ];
eo::log << eo::quiet << "Better solution found:" << d->table()[i].fitness() << std::endl;
best = d->table()[ i ];
}
}
}

View file

@ -101,7 +101,7 @@ int main(int argc, char** argv)
// This is the only thing which changes: we wrap the IsFinished function.
// According to RAII, we'll delete the invokated wrapper at the end of the main ; the store won't delete it
// automatically.
IsFinishedParallelApply* wrapper = new ShowWrappedResult<int>;
IsFinishedParallelApply<int>* wrapper = new ShowWrappedResult<int>;
store.wrapIsFinished( wrapper );
ParallelApply<int> job( assign, eo::mpi::DEFAULT_MASTER, store );