Fix CI: random class issue, t-eoRoulette and update the workflow
This commit is contained in:
parent
ec1a0f0c62
commit
93e89828b8
3 changed files with 7 additions and 16 deletions
7
.github/workflows/build_ubuntu_debug.yml
vendored
7
.github/workflows/build_ubuntu_debug.yml
vendored
|
|
@ -1,10 +1,5 @@
|
|||
name: Build Debug (Ubuntu)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
on: [push, pull_request]
|
||||
|
||||
env:
|
||||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
||||
|
|
|
|||
|
|
@ -68,16 +68,12 @@ public:
|
|||
}
|
||||
assert(not _pop[0].invalid());
|
||||
|
||||
const typename EOT::Fitness min_fit
|
||||
= std::min_element( std::begin(_pop), std::end(_pop) )
|
||||
->fitness();
|
||||
|
||||
cumulative.clear();
|
||||
cumulative.push_back(_pop[0].fitness() - min_fit);
|
||||
cumulative.push_back(_pop[0].fitness() );
|
||||
|
||||
for (unsigned i = 1; i < _pop.size(); ++i) {
|
||||
assert(not _pop[i].invalid());
|
||||
cumulative.push_back(cumulative.back() + _pop[i].fitness() - min_fit);
|
||||
cumulative.push_back(cumulative.back() + _pop[i].fitness());
|
||||
}
|
||||
assert(cumulative.size() == _pop.size());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -361,10 +361,10 @@ template<class Chrom> class eoUBitXover: public eoQuadOp<Chrom>
|
|||
{
|
||||
if (chrom1[i] != chrom2[i] && eo::rng.flip(preference))
|
||||
{
|
||||
// bool tmp = chrom1[i];
|
||||
// chrom1[i]=chrom2[i];
|
||||
// chrom2[i] = tmp;
|
||||
std::swap(chrom1[i], chrom2[i]);
|
||||
bool tmp = chrom1[i];
|
||||
chrom1[i]=chrom2[i];
|
||||
chrom2[i] = tmp;
|
||||
// std::swap(chrom1[i], chrom2[i]);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue