Class SumOfPenalties
java.lang.Object
dev.nm.solver.multivariate.constrained.general.penaltymethod.PenaltyFunction
dev.nm.solver.multivariate.constrained.general.penaltymethod.SumOfPenalties
- All Implemented Interfaces:
Function<Vector,
,Double> RealScalarFunction
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.nm.analysis.function.Function
Function.EvaluationException
-
Constructor Summary
ConstructorsConstructorDescriptionSumOfPenalties
(PenaltyFunction... penalties) Construct a sum-of-penalties penalty function from a set of penalty functions. -
Method Summary
Modifier and TypeMethodDescriptionint
Get the number of variables the function has.Evaluate the function f at x, where x is from the domain.Methods inherited from class dev.nm.solver.multivariate.constrained.general.penaltymethod.PenaltyFunction
dimensionOfRange
-
Constructor Details
-
SumOfPenalties
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 Details
-
evaluate
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
-