mirror of
https://github.com/paboyle/Grid.git
synced 2024-11-10 07:55:35 +00:00
Remove old macros for threading
This commit is contained in:
parent
f1c31df9d2
commit
be1511d469
@ -134,7 +134,6 @@ void GeneticScheduler<V, T>::nextGeneration(void)
|
|||||||
LOG(Debug) << "Starting population:\n" << *this << std::endl;
|
LOG(Debug) << "Starting population:\n" << *this << std::endl;
|
||||||
|
|
||||||
// random mutations
|
// random mutations
|
||||||
//PARALLEL_FOR_LOOP
|
|
||||||
for (unsigned int i = 0; i < par_.popSize; ++i)
|
for (unsigned int i = 0; i < par_.popSize; ++i)
|
||||||
{
|
{
|
||||||
doMutation();
|
doMutation();
|
||||||
@ -142,7 +141,6 @@ void GeneticScheduler<V, T>::nextGeneration(void)
|
|||||||
LOG(Debug) << "After mutations:\n" << *this << std::endl;
|
LOG(Debug) << "After mutations:\n" << *this << std::endl;
|
||||||
|
|
||||||
// mating
|
// mating
|
||||||
//PARALLEL_FOR_LOOP
|
|
||||||
for (unsigned int i = 0; i < par_.popSize/2; ++i)
|
for (unsigned int i = 0; i < par_.popSize/2; ++i)
|
||||||
{
|
{
|
||||||
doCrossover();
|
doCrossover();
|
||||||
@ -178,7 +176,7 @@ void GeneticScheduler<V, T>::doCrossover(void)
|
|||||||
Gene c1, c2;
|
Gene c1, c2;
|
||||||
|
|
||||||
crossover(c1, c2, p1, p2);
|
crossover(c1, c2, p1, p2);
|
||||||
PARALLEL_CRITICAL
|
thread_critical
|
||||||
{
|
{
|
||||||
population_.insert(std::make_pair(func_(c1), c1));
|
population_.insert(std::make_pair(func_(c1), c1));
|
||||||
population_.insert(std::make_pair(func_(c2), c2));
|
population_.insert(std::make_pair(func_(c2), c2));
|
||||||
@ -198,7 +196,7 @@ void GeneticScheduler<V, T>::doMutation(void)
|
|||||||
|
|
||||||
std::advance(it, pdis(gen_));
|
std::advance(it, pdis(gen_));
|
||||||
mutation(m, it->second);
|
mutation(m, it->second);
|
||||||
PARALLEL_CRITICAL
|
thread_critical
|
||||||
{
|
{
|
||||||
population_.insert(std::make_pair(func_(m), m));
|
population_.insert(std::make_pair(func_(m), m));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user