Fixing rotation for AbstractMultiModalProblemKnown.
This commit is contained in:
parent
43b2d031a1
commit
13f5219a19
@ -114,7 +114,8 @@ public abstract class AbstractMultiModalProblemKnown extends AbstractProblemDoub
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method returns the unnormalized function value for an maximization problem
|
* This method returns the unnormalized (and unrotated!) function value for an maximization problem.
|
||||||
|
*
|
||||||
* @param x The n-dimensional input vector
|
* @param x The n-dimensional input vector
|
||||||
* @return The m-dimensional output vector.
|
* @return The m-dimensional output vector.
|
||||||
*/
|
*/
|
||||||
@ -196,6 +197,10 @@ public abstract class AbstractMultiModalProblemKnown extends AbstractProblemDoub
|
|||||||
m_GlobalOpt = tmp;
|
m_GlobalOpt = tmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (isDoRotation()) {
|
||||||
|
point = inverseRotateMaybe(point); // theres an inverse rotation required
|
||||||
|
tmpIndy.SetDoubleGenotype(point);
|
||||||
|
}
|
||||||
this.m_ListOfOptima.add(tmpIndy);
|
this.m_ListOfOptima.add(tmpIndy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,6 +132,13 @@ public abstract class AbstractProblemDouble extends AbstractOptimizationProblem
|
|||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected double[] inverseRotateMaybe(double[] x) {
|
||||||
|
if (isDoRotation()) {
|
||||||
|
if (rotation==null) initProblem();
|
||||||
|
x = Mathematics.rotate(x, rotation.inverse());
|
||||||
|
}
|
||||||
|
return x;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Add all constraint violations to the individual. Expect that the fitness has already been set.
|
* Add all constraint violations to the individual. Expect that the fitness has already been set.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user