Use the feasibility of the current individual for the feasability of the metric in dual fitness assignment
This commit is contained in:
parent
80aa04d6da
commit
3d0db369bc
1 changed files with 10 additions and 8 deletions
|
|
@ -130,7 +130,10 @@ protected:
|
|||
metric( pop[i].objectiveVector(), pop[j].objectiveVector() ),
|
||||
pop[i].objectiveVector().is_feasible()
|
||||
);
|
||||
} // if i != j
|
||||
} else { // if i != j
|
||||
assert( i == j );
|
||||
values[i][j] = Type( 0.0, pop[i].objectiveVector().is_feasible() );
|
||||
}
|
||||
} // for j in pop
|
||||
} // for i in pop
|
||||
}
|
||||
|
|
@ -145,11 +148,10 @@ protected:
|
|||
|
||||
virtual Type computeFitness(const unsigned int _idx)
|
||||
{
|
||||
// Type result( 0.0, values[_idx][_idx].is_feasible() );
|
||||
Type result( 0.0, values[_idx][_idx].is_feasible() );
|
||||
for (unsigned int i=0; i<values.size(); i++)
|
||||
{
|
||||
if (i != _idx)
|
||||
{
|
||||
for (unsigned int i=0; i<values.size(); i++) {
|
||||
if (i != _idx) {
|
||||
result -= exp(-values[i][_idx]/kappa);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue