Package org.moeaframework.problem.ZCAT
Class ZCAT
java.lang.Object
org.moeaframework.problem.AbstractProblem
org.moeaframework.problem.ZCAT.ZCAT
- All Implemented Interfaces:
AutoCloseable,Named,AnalyticalProblem,Problem
- Direct Known Subclasses:
ZCAT1,ZCAT10,ZCAT11,ZCAT12,ZCAT13,ZCAT14,ZCAT15,ZCAT16,ZCAT17,ZCAT18,ZCAT19,ZCAT2,ZCAT20,ZCAT3,ZCAT4,ZCAT5,ZCAT6,ZCAT7,ZCAT8,ZCAT9
Abstract class for implementing ZCAT test problems.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleantrueif bias is applied;falseotherwise.static final doubleThe precision when considering if two floating-point numbers are equal.protected final org.moeaframework.problem.ZCAT.PFShapeFunctionThe shape function for the Pareto front.protected final org.moeaframework.problem.ZCAT.PSShapeFunctionThe shape function for the Pareto set.protected final booleantrueif imbalance is applied;falseotherwise.protected final intThe difficulty level between1and6.Fields inherited from class org.moeaframework.problem.AbstractProblem
numberOfConstraints, numberOfObjectives, numberOfVariables -
Constructor Summary
ConstructorsConstructorDescriptionZCAT(int numberOfObjectives, int level, boolean bias, boolean imbalance, org.moeaframework.problem.ZCAT.PFShapeFunction F, org.moeaframework.problem.ZCAT.PSShapeFunction G) Constructs a new ZCAT problem.ZCAT(int numberOfVariables, int numberOfObjectives, int level, boolean bias, boolean imbalance, org.moeaframework.problem.ZCAT.PFShapeFunction F, org.moeaframework.problem.ZCAT.PSShapeFunction G) Constructs a new ZCAT problem. -
Method Summary
Modifier and TypeMethodDescriptionvoidEvaluates the solution, updating the solution's objectives in place.protected double[]evaluateF(double[] alpha, double[] beta) Evaluates the final objective values by combining the position and distance values.protected doubleevaluateZ(double[] w, int i) Applies imbalance / the difficulty level to the intermediate vectorw.generate()Returns a randomly-generated solution using the analytical solution to this problem.protected double[]getAlpha(double[] y, org.moeaframework.problem.ZCAT.PFShapeFunction F) Computes the position of the solution on the Pareto front.protected double[]getBeta(double[] y, org.moeaframework.problem.ZCAT.PSShapeFunction G) Computes the distance of the solution to the Pareto front.intgetDimension(double[] y) The dimension of the Pareto front / Pareto set.protected double[]getJ(int i, double[] w) Computes theJvector.getName()Returns the name of this problem.protected double[]getW(double[] z, int m) Applies bias to thezvector when enabled.protected double[]getY(double[] x) Normalizes the decision variables.protected double[]getZ(double[] y, int m, org.moeaframework.problem.ZCAT.PSShapeFunction G) Applies the Pareto shape function to the decision variables.Returns a new solution for this problem.protected doubleZbias(double z) Calculates the bias for a single element of thezvector.Methods inherited from class org.moeaframework.problem.AbstractProblem
close, getNumberOfConstraints, getNumberOfObjectives, getNumberOfVariablesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.moeaframework.problem.Problem
close, getNumberOfConstraints, getNumberOfObjectives, getNumberOfVariables, isType
-
Field Details
-
EPSILON
public static final double EPSILONThe precision when considering if two floating-point numbers are equal. This differs fromSettings.EPSto match the original ZCAT source code. -
level
protected final int levelThe difficulty level between1and6. -
bias
protected final boolean biastrueif bias is applied;falseotherwise. -
imbalance
protected final boolean imbalancetrueif imbalance is applied;falseotherwise. -
F
protected final org.moeaframework.problem.ZCAT.PFShapeFunction FThe shape function for the Pareto front. -
G
protected final org.moeaframework.problem.ZCAT.PSShapeFunction GThe shape function for the Pareto set.
-
-
Constructor Details
-
ZCAT
public ZCAT(int numberOfObjectives, int level, boolean bias, boolean imbalance, org.moeaframework.problem.ZCAT.PFShapeFunction F, org.moeaframework.problem.ZCAT.PSShapeFunction G) Constructs a new ZCAT problem.- Parameters:
numberOfObjectives- the number of objectiveslevel- the difficulty level between1and6bias-trueif bias is applied to the decision variables;falseotherwiseimbalance-trueif imbalance is applied;falseotherwise.F- the Pareto front shape functionG- the Pareto set shape function
-
ZCAT
public ZCAT(int numberOfVariables, int numberOfObjectives, int level, boolean bias, boolean imbalance, org.moeaframework.problem.ZCAT.PFShapeFunction F, org.moeaframework.problem.ZCAT.PSShapeFunction G) Constructs a new ZCAT problem.- Parameters:
numberOfVariables- the number of decision variablesnumberOfObjectives- the number of objectiveslevel- the difficulty level between1and6bias-trueif bias is applied to the decision variables;falseotherwiseimbalance-trueif imbalance is applied;falseotherwise.F- the Pareto front shape functionG- the Pareto set shape function
-
-
Method Details
-
getName
Description copied from interface:ProblemReturns the name of this problem. Whenever possible, this name should match the name recognized byProblemFactory. -
evaluate
Description copied from interface:ProblemEvaluates the solution, updating the solution's objectives in place. Algorithms must explicitly call this method when appropriate to evaluate new solutions or reevaluate modified solutions. -
newSolution
Description copied from interface:ProblemReturns a new solution for this problem. Implementations must initialize the variables so that the valid range of values is defined, but typically leave the actual value at a default or undefined state.- Specified by:
newSolutionin interfaceProblem- Returns:
- a new solution for this problem
-
getDimension
public int getDimension(double[] y) The dimension of the Pareto front / Pareto set. This is typicallynumberOfObjectives-1but can differ for certain degenerate (ZCAT14 - ZCAT16) or hybrid (ZCAT19 - ZCAT20) problems.- Parameters:
y- the normalized decision variables- Returns:
- the dimension of the Pareto front / Pareto set
-
getAlpha
protected double[] getAlpha(double[] y, org.moeaframework.problem.ZCAT.PFShapeFunction F) Computes the position of the solution on the Pareto front.- Parameters:
y- the normalized decision variable valuesF- the function defining the Pareto front shape- Returns:
- the position values
-
getBeta
protected double[] getBeta(double[] y, org.moeaframework.problem.ZCAT.PSShapeFunction G) Computes the distance of the solution to the Pareto front.- Parameters:
y- the normalized decision variable valuesG- the function defining the Pareto set shape- Returns:
- the distance values
-
getJ
protected double[] getJ(int i, double[] w) Computes theJvector.- Parameters:
i- the objective indexw- thewvector- Returns:
- the intermediate vector
J
-
getW
protected double[] getW(double[] z, int m) Applies bias to thezvector when enabled.- Parameters:
z- thezvectorm- the dimension of the Pareto front / set- Returns:
- the result of biasing the
zvector
-
getY
protected double[] getY(double[] x) Normalizes the decision variables.- Parameters:
x- the raw, unnormalized decision variable values- Returns:
- the normalized decision variables values scaled between
[0, 1]
-
getZ
protected double[] getZ(double[] y, int m, org.moeaframework.problem.ZCAT.PSShapeFunction G) Applies the Pareto shape function to the decision variables.- Parameters:
y- the normalized decision variablesm- the dimension of the Pareto front / setG- the Pareto shape function- Returns:
- the resulting vector
z
-
Zbias
protected double Zbias(double z) Calculates the bias for a single element of thezvector.- Parameters:
z- the single element of thezvector- Returns:
- the value with bias applied
-
evaluateZ
protected double evaluateZ(double[] w, int i) Applies imbalance / the difficulty level to the intermediate vectorw.- Parameters:
w- the intermediate vectorwi- the index- Returns:
- the result of applying the imbalance / difficulty level function
-
evaluateF
protected double[] evaluateF(double[] alpha, double[] beta) Evaluates the final objective values by combining the position and distance values.- Parameters:
alpha- the position valuesbeta- the distance values- Returns:
- the final objective values
-
generate
Description copied from interface:AnalyticalProblemReturns a randomly-generated solution using the analytical solution to this problem. The exact behavior of this method depends on the implementation, but in general (1) the solutions should be non-dominated and (2) spread uniformly across the Pareto front.It is not always possible to guarantee these conditions. For example, a discontinuous / disconnected Pareto surface could generate dominated solutions, and a biased problem could result in non-uniform distributions. Therefore, we recommend callers filter solutions through a
NondominatedPopulation, in particular one that maintains a spread of solutions.Furthermore, some implementations may not provide the corresponding decision variables for the solution. These implementations should indicate this by returning a solution with
0decision variables.- Specified by:
generatein interfaceAnalyticalProblem- Returns:
- a randomly-generated Pareto optimal solution to this problem
-