public class CoreHunter extends Object
Constructor and Description |
---|
CoreHunter() |
CoreHunter(CoreHunterExecutionMode mode)
Create Core Hunter facade with the specified mode.
|
Modifier and Type | Method and Description |
---|---|
double |
evaluate(org.jamesframework.core.subset.SubsetSolution sol,
CoreHunterData data,
CoreHunterObjective objective)
Evaluate the given solution with the specified objective.
|
org.jamesframework.core.subset.SubsetSolution |
execute(CoreHunterArguments arguments) |
CoreHunterListener |
getListener() |
long |
getMaxSteps()
Get the maximum number of search steps.
|
long |
getMaxStepsWithoutImprovement()
Get the maximum allowed number of search steps without finding an improvement.
|
long |
getMaxTimeWithoutImprovement()
Get the maximum allowed time without finding an improvement (milliseconds).
|
long |
getTimeLimit()
Get execution time limit (milliseconds).
|
List<Range<Double>> |
normalize(CoreHunterArguments arguments)
Determine normalization ranges of all objectives in a multi-objective configuration, based on the
Pareto minima/maxima.
|
void |
setListener(CoreHunterListener listener) |
void |
setMaxSteps(long steps)
Sets the maximum number of search steps.
|
void |
setMaxStepsWithoutImprovement(long steps)
Sets the maximum allowed number of search steps without finding an improvement.
|
void |
setMaxTimeWithoutImprovement(long ms)
Sets the maximum time without finding any improvements (in milliseconds).
|
void |
setSeed(long seed) |
void |
setTimeLimit(long ms)
Sets the absolute time limit (in milliseconds).
|
public CoreHunter()
public CoreHunter(CoreHunterExecutionMode mode)
In CoreHunterExecutionMode.DEFAULT
mode, parallel tempering is applied
and terminated when no improvement has been made for ten seconds.
In CoreHunterExecutionMode.FAST
mode, random descent is applied
and terminated when no improvement has been made for two seconds.
By default no absolute time limit, nor any step-based stop conditions,
are set in any of the two modes.
Stop conditions can be altered with setTimeLimit(long)
,
setMaxTimeWithoutImprovement(long)
, setMaxSteps(long)
and setMaxStepsWithoutImprovement(long)
. As soon as one or more
explicit stop conditions have been specified prior to execution, the default
maximum time without improvement will not be applied.
In case of a multi-objective configuration with normalization enabled, a preliminary random descent search is executed per objective to determine suitable normalization ranges based on the Pareto minima/maxima. These normalization searches are executed in parallel, with the same stop conditions as used for the main search. In default mode however, any step-based stop conditions are rescaled for the random descent normalization searches, since then the main parallel tempering search executes 500 random descent steps within each replica, in a single step of the main search.
mode
- execution modepublic List<Range<Double>> normalize(CoreHunterArguments arguments)
normalize
is set to false
in the
given arguments
, an exception is thrown.arguments
- Core Hunter arguments specifying dataset, core size and objectivesIllegalArgumentException
- If normalization is disabled in the arguments or in case of a
single-objective configuration.public org.jamesframework.core.subset.SubsetSolution execute(CoreHunterArguments arguments)
public double evaluate(org.jamesframework.core.subset.SubsetSolution sol, CoreHunterData data, CoreHunterObjective objective)
sol
- subset solutiondata
- Core Hunter dataobjective
- objective used to evaluate the subset (weight is ignored)public long getTimeLimit()
public void setTimeLimit(long ms)
ms
- absolute time limit in millisecondspublic long getMaxTimeWithoutImprovement()
public void setMaxTimeWithoutImprovement(long ms)
ms
- maximum time without improvement in millisecondspublic long getMaxSteps()
public void setMaxSteps(long steps)
steps
- search step limitpublic long getMaxStepsWithoutImprovement()
public void setMaxStepsWithoutImprovement(long steps)
steps
- maximum number of steps without improvementpublic CoreHunterListener getListener()
public void setListener(CoreHunterListener listener)
public void setSeed(long seed)
Copyright © 2017. All rights reserved.