Class SumOfPenalties

  • All Implemented Interfaces:
    Function<Vector,​Double>, RealScalarFunction

    public class SumOfPenalties
    extends PenaltyFunction
    This penalty function sums up the costs from a set of constituent penalty functions. This builds a new composite penalty function from existing simpler ones. It applies to any constrained optimization problems.
    • Constructor Detail

      • SumOfPenalties

        public SumOfPenalties​(PenaltyFunction... penalties)
        Construct a sum-of-penalties penalty function from a set of penalty functions. The penalties must have the same dimension.
        Parameters:
        penalties - the constituent penalty functions
    • Method Detail

      • evaluate

        public Double evaluate​(Vector x)
        Description copied from interface: Function
        Evaluate the function f at x, where x is from the domain.
        Parameters:
        x - x
        Returns:
        f(x)
      • dimensionOfDomain

        public int dimensionOfDomain()
        Description copied from interface: Function
        Get the number of variables the function has. For example, for a univariate function, the domain dimension is 1; for a bivariate function, the domain dimension is 2.
        Returns:
        the number of variables