Package org.moeaframework.problem.ZCAT
Class ZCAT
java.lang.Object
org.moeaframework.problem.AbstractProblem
org.moeaframework.problem.ZCAT.ZCAT
- All Implemented Interfaces:
AutoCloseable
,Problem
,AnalyticalProblem
- 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
Modifier and TypeFieldDescriptionprotected final boolean
true
if bias is applied;false
otherwise.static final double
The precision when considering if two floating-point numbers are equal.protected final org.moeaframework.problem.ZCAT.PFShapeFunction
The shape function for the Pareto front.protected final org.moeaframework.problem.ZCAT.PSShapeFunction
The shape function for the Pareto set.protected final boolean
true
if imbalance is applied;false
otherwise.protected final int
The difficulty level between1
and6
.Fields inherited from class org.moeaframework.problem.AbstractProblem
numberOfConstraints, numberOfObjectives, numberOfVariables
-
Constructor Summary
ConstructorDescriptionZCAT
(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 TypeMethodDescriptionvoid
Evaluates 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 double
evaluateZ
(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.int
getDimension
(double[] y) The dimension of the Pareto front / Pareto set.protected double[]
getJ
(int i, double[] w) Computes theJ
vector.getName()
Returns the user-friendly name for this problem.protected double[]
getW
(double[] z, int m) Applies bias to thez
vector 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 double
Zbias
(double z) Calculates the bias for a single element of thez
vector.Methods inherited from class org.moeaframework.problem.AbstractProblem
close, getNumberOfConstraints, getNumberOfObjectives, getNumberOfVariables
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.moeaframework.core.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.EPS
to match the original ZCAT source code. -
level
protected final int levelThe difficulty level between1
and6
. -
bias
protected final boolean biastrue
if bias is applied;false
otherwise. -
imbalance
protected final boolean imbalancetrue
if imbalance is applied;false
otherwise. -
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 between1
and6
bias
-true
if bias is applied to the decision variables;false
otherwiseimbalance
-true
if imbalance is applied;false
otherwise.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 between1
and6
bias
-true
if bias is applied to the decision variables;false
otherwiseimbalance
-true
if imbalance is applied;false
otherwise.F
- the Pareto front shape functionG
- the Pareto set shape function
-
-
Method Details
-
getName
Description copied from interface:Problem
Returns the user-friendly name for this problem.- Specified by:
getName
in interfaceProblem
- Overrides:
getName
in classAbstractProblem
- Returns:
- the user-friendly name for this problem
-
evaluate
Description copied from interface:Problem
Evaluates 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:Problem
Returns 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:
newSolution
in 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-1
but 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 theJ
vector.- Parameters:
i
- the objective indexw
- thew
vector- Returns:
- the intermediate vector
J
-
getW
protected double[] getW(double[] z, int m) Applies bias to thez
vector when enabled.- Parameters:
z
- thez
vectorm
- the dimension of the Pareto front / set- Returns:
- the result of biasing the
z
vector
-
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 thez
vector.- Parameters:
z
- the single element of thez
vector- 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 vectorw
i
- 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:AnalyticalProblem
Returns 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
0
decision variables.- Specified by:
generate
in interfaceAnalyticalProblem
- Returns:
- a randomly-generated Pareto optimal solution to this problem
-