Class CMAESOptimizer.FitnessFunction

  • Enclosing class:
    CMAESOptimizer

    private class CMAESOptimizer.FitnessFunction
    extends java.lang.Object
    Normalizes fitness values to the range [0,1]. Adds a penalty to the fitness value if out of range.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean isRepairMode
      Flag indicating whether the objective variables are forced into their bounds if defined
    • Constructor Summary

      Constructors 
      Constructor Description
      FitnessFunction()
      Simple constructor.
    • Field Detail

      • isRepairMode

        private final boolean isRepairMode
        Flag indicating whether the objective variables are forced into their bounds if defined
    • Constructor Detail

      • FitnessFunction

        FitnessFunction()
        Simple constructor.
    • Method Detail

      • value

        public CMAESOptimizer.ValuePenaltyPair value​(double[] point)
        Parameters:
        point - Normalized objective variables.
        Returns:
        the objective value + penalty for violated bounds.
      • isFeasible

        public boolean isFeasible​(double[] x)
        Parameters:
        x - Normalized objective variables.
        Returns:
        true if in bounds.
      • repair

        private double[] repair​(double[] x)
        Parameters:
        x - Normalized objective variables.
        Returns:
        the repaired (i.e. all in bounds) objective variables.
      • penalty

        private double penalty​(double[] x,
                               double[] repaired)
        Parameters:
        x - Normalized objective variables.
        repaired - Repaired objective variables.
        Returns:
        Penalty value according to the violation of the bounds.