Fixing rotation for AbstractMultiModalProblemKnown.
This commit is contained in:
		@@ -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
 | 
			
		||||
	 * @return  The m-dimensional output vector.
 | 
			
		||||
	 */
 | 
			
		||||
@@ -196,6 +197,10 @@ public abstract class AbstractMultiModalProblemKnown extends AbstractProblemDoub
 | 
			
		||||
				m_GlobalOpt = tmp;
 | 
			
		||||
			}
 | 
			
		||||
		} 
 | 
			
		||||
		if (isDoRotation()) {
 | 
			
		||||
			point = inverseRotateMaybe(point); // theres an inverse rotation required
 | 
			
		||||
			tmpIndy.SetDoubleGenotype(point);
 | 
			
		||||
		}
 | 
			
		||||
		this.m_ListOfOptima.add(tmpIndy);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -132,6 +132,13 @@ public abstract class AbstractProblemDouble extends AbstractOptimizationProblem
 | 
			
		||||
		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.
 | 
			
		||||
	 * 
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user