Package org.moeaframework.core
Class Settings
java.lang.Object
org.moeaframework.core.Settings
Global settings used by this framework.
The settings are loaded from the system properties, set when starting Java using
java -Dorg.moeaframework.core.foo=bar ...
or the properties file.
The default properties file is "moeaframework.properties" and should be located in the working directory
where Java is started. This can be overridden by setting org.moeaframework.configuration=<file>
.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The default buffer size.static final String
The default configuration file.static final int
The default population size.static final double
Level of significance or machine precision.static final String
The property key for enabling consistency checks in the CMA-ES algorithm.static final String
The property key for setting the configuration file.static final String
The property key for the continuity correction flag.static final String
The property key for the algorithms available in the diagnostic tool.static final String
The property key for the problems available in the diagnostic tool.static final String
The property key for how to handle duplicate solutions in a nondominated population.static final String
The property key for enabling debugging info when running external problems.static final String
Deprecated.static final String
The property key for configuring the number of retry attempts when running external problems.static final String
The property key for configuring the retry delay when running external problems.static final String
The property key for configuring the shutdown timeout when running external problems.static final String
The property key to indicate that fast non-dominated sorting should be used.static final String
The property key for the power used in the generational distance calculation.static final String
The property key for the genetic programming protected functions flag.static final String
The property key for setting the display width of help messages from command line tools.static final String
The property key for the hypervolume command.static final String
The property key for the hypervolume delta when determining the reference point.static final String
The property key for the hypervolume flag.static final String
The property key for the hypervolume inversion flag.static final String
The property key for the power used in the inverted generational distance calculation.static final String
The property key for setting a global PRNG seed, which can be used to make results reproducible.static final String
The property key for the list of available problems.static final String
The prefix for all problem property keys.static final String
The property key to indicate that truncation warnings should be suppressed.static final String
The property key for enabling verbose logging.static final TypedProperties
The global properties object. -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Creates the key for a property by concatenating an optional prefix with one or more parts.static PropertyScope
Creates a new scope wherein settings can be temporarily modified.Returns the list of algorithms displayed in the diagnostic tool GUI.Returns the list of problems displayed in the diagnostic tool GUI.Returns the strategy used for handling duplicate solutions in a nondominated population.static int
Returns the number of retry attempts when connecting to an external problem with sockets.static Duration
Returns the delay, given in seconds, between retry attempts when connecting to an external problem with sockets.static Duration
Returns the timeout, given in seconds, the external process is given to shutdown cleanly before a forceful shutdown is attempted.static double
Returns the power used in the generational distance calculation.static String
Returns the native hypervolume command; ornull
if the default hypervolume implementation is used.static double
Returns the delta applied to the nadir point of the reference set when calculating the hypervolume.static MultiResolutionImage
getIcon()
Returns the MOEA Framework icon, supporting a varient of sizes.static double
Returns the power used in the inverted generational distance calculation.static String
getProblemClass
(String name) Returns the class for the specified problem.static String
getProblemReferenceSet
(String name) Returns the reference set filename for the specified problem.Returns the list of available problems.static Epsilons
getProblemSpecificEpsilons
(String problem) Returns a problem-specific ε value used in algorithms, archives, and other objects based on ε dominance.static double
getProblemSpecificHypervolumeDelta
(String problem) Returns a problem-specific delta used for hypervolume calculations, or the default fromgetHypervolumeDelta()
if no problem-specific value is configured.static double[]
getProblemSpecificMaximumBounds
(String problem) Returns the configured maximum bounds (reference point) used for normalization, ornull
if not configured.static double[]
getProblemSpecificMinimumBounds
(String problem) Returns the configured minimum bounds (ideal point) used for normalization, ornull
if not configured.static boolean
Returnstrue
if the CMA-ES algorithm has consistency checks enabled.static boolean
Returnstrue
if continuity correction is enabled;false
otherwise.static boolean
Returnstrue
if debugging is enabled when running external problems.static boolean
Returnstrue
if hypervolume calculation is enabled;false
otherwise.static boolean
Returnstrue
if the approximation set is inverted prior to being passed to the custom hypervolume implementation; otherwisefalse
.static boolean
isNormalizationDisabled
(String problem) Returnstrue
if normalization has been disabled for the given problem instance.static boolean
Returnstrue
if genetic programming functions should use protection against invalid arguments that would otherwise result inNaN
or other invalid values;false
otherwise.static boolean
Returnstrue
if truncation warnings, when implicitly converting a real-valued property to an integer and truncating the decimal value, should be suppressed.static boolean
Returnstrue
if verbose logging is enabled;false
otherwise.static void
reload()
Clears any existing settings and reloads the properties.static boolean
Returnstrue
if fast non-dominated sorting should be used; orfalse
if the naive non-dominated sorting implementation is preferred.
-
Field Details
-
EPS
public static final double EPSLevel of significance or machine precision.- See Also:
-
BUFFER_SIZE
public static final int BUFFER_SIZEThe default buffer size. Currently set to 4096 bytes.- See Also:
-
DEFAULT_POPULATION_SIZE
public static final int DEFAULT_POPULATION_SIZEThe default population size.- See Also:
-
DEFAULT_CONFIGURATION_FILE
The default configuration file.- See Also:
-
PROPERTIES
The global properties object. -
KEY_CONFIGURATION_FILE
The property key for setting the configuration file. This defaults to "moeaframework.properties" if unset. -
KEY_VERBOSE
The property key for enabling verbose logging. -
KEY_PRNG_SEED
The property key for setting a global PRNG seed, which can be used to make results reproducible. Note, however, that the seed is set once during initialization. -
KEY_HELP_WIDTH
The property key for setting the display width of help messages from command line tools. -
KEY_DUPLICATE_MODE
The property key for how to handle duplicate solutions in a nondominated population. -
KEY_GD_POWER
The property key for the power used in the generational distance calculation. -
KEY_IGD_POWER
The property key for the power used in the inverted generational distance calculation. -
KEY_FAST_NONDOMINATED_SORTING
The property key to indicate that fast non-dominated sorting should be used. -
KEY_SUPPRESS_TRUNCATION_WARNING
The property key to indicate that truncation warnings should be suppressed. -
KEY_CONTINUITY_CORRECTION
The property key for the continuity correction flag. -
KEY_HYPERVOLUME_DELTA
The property key for the hypervolume delta when determining the reference point. -
KEY_HYPERVOLUME
The property key for the hypervolume command. -
KEY_HYPERVOLUME_INVERTED
The property key for the hypervolume inversion flag. -
KEY_HYPERVOLUME_ENABLED
The property key for the hypervolume flag. -
KEY_PROBLEM_PREFIX
The prefix for all problem property keys. -
KEY_PROBLEM_LIST
The property key for the list of available problems. -
KEY_DIAGNOSTIC_TOOL_ALGORITHMS
The property key for the algorithms available in the diagnostic tool. -
KEY_DIAGNOSTIC_TOOL_PROBLEMS
The property key for the problems available in the diagnostic tool. -
KEY_CMAES_CHECK_CONSISTENCY
The property key for enabling consistency checks in the CMA-ES algorithm. -
KEY_GP_PROTECTED_FUNCTIONS
The property key for the genetic programming protected functions flag. -
KEY_EXTERNAL_PROBLEM_DEBUGGING_DEPRECATED
Deprecated.UseKEY_EXTERNAL_PROBLEM_DEBUGGING
insteadThe property key for enabling debugging info when running external problems. -
KEY_EXTERNAL_PROBLEM_DEBUGGING
The property key for enabling debugging info when running external problems. -
KEY_EXTERNAL_RETRY_ATTEMPTS
The property key for configuring the number of retry attempts when running external problems. -
KEY_EXTERNAL_RETRY_DELAY
The property key for configuring the retry delay when running external problems. -
KEY_EXTERNAL_SHUTDOWN_TIMEOUT
The property key for configuring the shutdown timeout when running external problems.
-
-
Method Details
-
reload
public static void reload()Clears any existing settings and reloads the properties. -
isVerbose
public static boolean isVerbose()Returnstrue
if verbose logging is enabled;false
otherwise.- Returns:
true
if verbose logging is enabled;false
otherwise
-
isContinuityCorrection
public static boolean isContinuityCorrection()Returnstrue
if continuity correction is enabled;false
otherwise. Rank-based statistical inference methods, such as the Mann-Whitney U test and the Wilcoxon Signed-Ranks test, approximate the test's discrete distribution with a continuous distribution for computing the p-value. It has been recommended but not often employed in practice to apply a continuity correction.- Returns:
true
if continuity correction is enabled;false
otherwise
-
getDuplicateMode
Returns the strategy used for handling duplicate solutions in a nondominated population.- Returns:
- the strategy for handling duplicate solutions
-
getGDPower
public static double getGDPower()Returns the power used in the generational distance calculation. The default value is 2.0.- Returns:
- the power used in the generational distance calculation
-
getIGDPower
public static double getIGDPower()Returns the power used in the inverted generational distance calculation. The default value is 1.0.- Returns:
- the power used in the inverted generational distance calculation
-
useFastNondominatedSorting
public static boolean useFastNondominatedSorting()Returnstrue
if fast non-dominated sorting should be used; orfalse
if the naive non-dominated sorting implementation is preferred. The default isfalse
since while the fast version has better worst-case time complexity, the naive version tends to run faster except for a small number of edge cases.- Returns:
true
if fast non-dominated sorting should be used; orfalse
if the naive non-dominated sorting implementation is preferred
-
isSuppressTruncationWarning
public static boolean isSuppressTruncationWarning()Returnstrue
if truncation warnings, when implicitly converting a real-valued property to an integer and truncating the decimal value, should be suppressed.- Returns:
true
if truncation warnings are suppressed;false
otherwise
-
getHypervolumeDelta
public static double getHypervolumeDelta()Returns the delta applied to the nadir point of the reference set when calculating the hypervolume. Having a non-zero delta is necessary to ensure extremal solutions contribute to the hypervolume.- Returns:
- the delta applied to the nadir point of the reference set when calculating the hypervolume
-
getHypervolume
Returns the native hypervolume command; ornull
if the default hypervolume implementation is used. The default hypervolume implementation may become computationally prohibitive on large approximation sets or at high dimensions. SeeNativeHypervolume
for more details on formatting the command.- Returns:
- the native hypervolume command; or
null
if the default hypervolume implementation is used
-
isHypervolumeInverted
public static boolean isHypervolumeInverted()Returnstrue
if the approximation set is inverted prior to being passed to the custom hypervolume implementation; otherwisefalse
.- Returns:
true
if the approximation set is inverted prior to being passed to the custom hypervolume implementation; otherwisefalse
-
isHypervolumeEnabled
public static boolean isHypervolumeEnabled()Returnstrue
if hypervolume calculation is enabled;false
otherwise. When disabled, the hypervolume should be reported asDouble.NaN
. Direct use of theHypervolume
class remains unaffected by this option.- Returns:
true
if hypervolume calculation is enabled;false
otherwise
-
getProblemSpecificMinimumBounds
Returns the configured minimum bounds (ideal point) used for normalization, ornull
if not configured.- Parameters:
problem
- the problem name- Returns:
- the minimum bounds or
null
-
getProblemSpecificMaximumBounds
Returns the configured maximum bounds (reference point) used for normalization, ornull
if not configured.- Parameters:
problem
- the problem name- Returns:
- the maximum bounds or
null
-
getProblemSpecificHypervolumeDelta
Returns a problem-specific delta used for hypervolume calculations, or the default fromgetHypervolumeDelta()
if no problem-specific value is configured.- Parameters:
problem
- the problem name- Returns:
- the hypervolume delta
-
getProblemSpecificEpsilons
Returns a problem-specific ε value used in algorithms, archives, and other objects based on ε dominance.- Parameters:
problem
- the problem name- Returns:
- the ε values or
null
if no override provided
-
isNormalizationDisabled
Returnstrue
if normalization has been disabled for the given problem instance.- Parameters:
problem
- the problem name- Returns:
true
if disabled;false
otherwise
-
getProblems
Returns the list of available problems. This allows enumerating additional problems without the need for defining and registering a service provider on the classpath.- Returns:
- the list of available problems
-
getProblemClass
Returns the class for the specified problem.- Parameters:
name
- the problem name- Returns:
- the class for the specified problem
-
getProblemReferenceSet
Returns the reference set filename for the specified problem.- Parameters:
name
- the problem name- Returns:
- the reference set filename for the specified problem
-
getDiagnosticToolAlgorithms
Returns the list of algorithms displayed in the diagnostic tool GUI.- Returns:
- the list of algorithms displayed in the diagnostic tool GUI
-
getDiagnosticToolProblems
Returns the list of problems displayed in the diagnostic tool GUI.- Returns:
- the list of problems displayed in the diagnostic tool GUI
-
isProtectedFunctions
public static boolean isProtectedFunctions()Returnstrue
if genetic programming functions should use protection against invalid arguments that would otherwise result inNaN
or other invalid values;false
otherwise.- Returns:
true
if genetic programming functions should use protection against invalid arguments that would otherwise result inNaN
or other invalid values;false
otherwise
-
isExternalProblemDebuggingEnabled
public static boolean isExternalProblemDebuggingEnabled()Returnstrue
if debugging is enabled when running external problems.- Returns:
true
if debugging for external problems is enabled;false
otherwise
-
getExternalProblemRetryAttempts
public static int getExternalProblemRetryAttempts()Returns the number of retry attempts when connecting to an external problem with sockets.- Returns:
- the number of retry attempts
-
getExternalProblemRetryDelay
Returns the delay, given in seconds, between retry attempts when connecting to an external problem with sockets.- Returns:
- the retry delay
-
getExternalProblemShutdownTimeout
Returns the timeout, given in seconds, the external process is given to shutdown cleanly before a forceful shutdown is attempted.- Returns:
- the shutdown timeout
-
isCMAESConsistencyCheckingEnabled
public static boolean isCMAESConsistencyCheckingEnabled()Returnstrue
if the CMA-ES algorithm has consistency checks enabled.- Returns:
true
if the CMA-ES algorithm has consistency checks enabled;false
otherwise
-
getIcon
Returns the MOEA Framework icon, supporting a varient of sizes.- Returns:
- the MOEA Framework icon
-
createKey
Creates the key for a property by concatenating an optional prefix with one or more parts.- Parameters:
prefix
- the prefix or first part of the keyparts
- remaining parts of the key- Returns:
- the full key
-
createScope
Creates a new scope wherein settings can be temporarily modified. Upon closing the scope, the original settings are restored.- Returns:
- the scope
-
KEY_EXTERNAL_PROBLEM_DEBUGGING
instead