SolutionType
- solution type of the analyzed problemspublic class Analysis<SolutionType extends org.jamesframework.core.problems.Solution> extends Object
This analysis class can be used to set up and run an experiment with different search algorithms applied to several problem instances, for example with different data sets, objectives or problem parameters. It can also be used to perform a parameter sweep for a certain algorithm (e.g. for temperatures in parallel tempering, or the tabu list size in tabu search) and to try out different neighbourhood functions.
By default, each algorithm is executed 10 times because most searches are randomized. The number of repeats can be tuned on an overall as well as search specific level. It is advised to perform a sufficient amount of repeats so that stable results are obtained. By default, one additional burn-in run is performed for which no results are tracked. This can also be adjusted on an overall or search specific level.
Constructor and Description |
---|
Analysis()
Create an analysis object.
|
Modifier and Type | Method and Description |
---|---|
Analysis<SolutionType> |
addProblem(String ID,
org.jamesframework.core.problems.Problem<SolutionType> problem)
Add a problem to be analyzed.
|
Analysis<SolutionType> |
addSearch(String ID,
SearchFactory<SolutionType> searchFactory)
Add a search to be applied to solve the analyzed problems.
|
int |
getNumBurnIn()
Get the global number of additional burn-in runs that will be performed for every applied
search for which no search specific number of burn-in runs has been set.
|
int |
getNumBurnIn(String searchID)
Get the number of additional burn-in runs that will be performed for the search with the given ID.
|
int |
getNumRuns()
Get the global number of runs that will be performed for every applied search
for which no search specific number of runs has been set.
|
int |
getNumRuns(String searchID)
Get the number of runs that will be performed for the search with the given ID.
|
AnalysisResults<SolutionType> |
run()
Run the analysis.
|
Analysis<SolutionType> |
setNumBurnIn(int n)
Set the global number of additional burn-in runs that will be performed for every applied
search for which no search specific number of burn-in runs is set.
|
Analysis<SolutionType> |
setNumBurnIn(String searchID,
int n)
Set the number of additional burn-in runs to be performed for the given search.
|
Analysis<SolutionType> |
setNumRuns(int n)
Set the global number of runs that will be performed for every applied search
for which no search specific number of runs is set.
|
Analysis<SolutionType> |
setNumRuns(String searchID,
int n)
Set the number of runs to be performed for the given search.
|
public Analysis()
public int getNumRuns()
setNumRuns(int)
. To set a search specific numer of runs,
use setNumRuns(String, int)
.public Analysis<SolutionType> setNumRuns(int n)
n
- global number of search runs to be performedIllegalArgumentException
- if n
is not strictly positivepublic int getNumBurnIn()
Get the global number of additional burn-in runs that will be performed for every applied search for which no search specific number of burn-in runs has been set. Burn-in runs are executed before the actual search runs and not registered in the results, to "warm up" the analysis in order to reduce the influence of just in time compilation (JIT) and on the fly optimizations performed by the JVM.
Defaults to 1 and can be changed using setNumBurnIn(int)
. To set a search specific
number of additional burn-in runs, use setNumBurnIn(String, int)
.
public Analysis<SolutionType> setNumBurnIn(int n)
Set the global number of additional burn-in runs that will be performed for every applied search for which no search specific number of burn-in runs is set. Burn-in runs are executed before the actual search runs and not registered in the results, to "warm up" the analysis in order to reduce the influence of just in time compilation (JIT) and on the fly optimizations performed by the JVM.
To set a search specific number of additional burn-in runs, use setNumBurnIn(String, int)
.
Returns a reference to the analysis object on which this method was called so that methods can be chained.
n
- global number of additional burn-in runs to be performedIllegalArgumentException
- if n
is not strictly positivepublic int getNumRuns(String searchID)
setNumRuns(String, int)
, the global
value obtained from getNumRuns()
is returned.searchID
- ID of the searchUnknownIDException
- if no search with this ID has been addedpublic Analysis<SolutionType> setNumRuns(String searchID, int n)
searchID
- ID of the searchn
- number of runs to be performed for this specific searchUnknownIDException
- if no search with this ID has been addedIllegalArgumentException
- if n
is not strictly positivepublic int getNumBurnIn(String searchID)
setNumBurnIn(String, int)
,
the global value obtained from getNumBurnIn()
is returned. Burn-in runs are executed before the
actual search runs and not registered in the results, to "warm up" the analysis in order to reduce the
influence of just in time compilation (JIT) and on the fly optimizations performed by the JVM.searchID
- ID of the searchUnknownIDException
- if no search with this ID has been addedpublic Analysis<SolutionType> setNumBurnIn(String searchID, int n)
searchID
- ID of the searchn
- number of additional burn-in runs to be performed for this specific searchUnknownIDException
- if no search with this ID has been addedIllegalArgumentException
- if n
is not strictly positivepublic Analysis<SolutionType> addProblem(String ID, org.jamesframework.core.problems.Problem<SolutionType> problem)
ID
- unique ID of the added problemproblem
- problem to be added to the analysisDuplicateIDException
- if a problem has already been added with the specified IDNullPointerException
- if problem
is null
public Analysis<SolutionType> addSearch(String ID, SearchFactory<SolutionType> searchFactory)
ID
- unique ID of the added searchsearchFactory
- factory that creates a search given the problem to be solvedDuplicateIDException
- if a search has already been added with the specified IDNullPointerException
- if searchFactory
is null
public AnalysisResults<SolutionType> run()
org.jamesframework.core.exceptions.JamesRuntimeException
- if anything goes wrong during any of the searches due to misconfigurationCopyright © 2015. All rights reserved.