public abstract class GridProblemMediator extends IterateMediatorEvolve
Modifier and Type | Field and Description |
---|---|
protected java.lang.Object |
bestOptValue
The best optimal value
|
protected java.lang.Object |
currentOptValue
The current optimal value
|
protected EvalBounds |
intermediateBounds
Intermediate solution results
|
protected MatchResult |
lastGridSolution
The previous grid solution, before this one
|
protected int |
maxSolutionsNumber
Maximum allowed number of solutions
|
protected int |
partProblemNumber
The maximum number of problem parts if required
|
protected int |
partProblemSize
The maximum size for part of a problem if required
|
protected int |
wholeProblemSize
The maximum size for a whole problem if required
|
resultsBetter
dataHash, serviceNames, solutionHierarc
bestResult, fullTrace, problem, result, solutionOrder, solutionSet, solutionsNumber, solverType, testEnded
constructorParams, createServices, dataConditions, datasetType, dirPath, externalScript, heuristicOptions, heuristicType, inputVariables, linkSpec, metricType, serverSpec, serviceClasses, serviceJarFiles, servicesNum, serviceType, tokenizer
Constructor and Description |
---|
GridProblemMediator(org.licas.PasswordHandler thePasswordHandler)
Create a new instance of GridProblemMediator.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
calcResultsBetter(MatchResult solutionSet)
This method checks for conditions that indicate that the current set of
results are better than the previous set.
|
protected void |
calcTestEnded(MatchResult solutionSet)
Check for conditions that indicate that the test runs have or should be
terminated.
|
void |
copyToConfig(TestSpec testSpec)
Copy any values specific to the problem solver classes to the related specific
structures, from the more general list of variables from the Problem Spec itself.
|
int |
getMaxSolutionsNumber()
Get the maximum number of allowed solutions.
|
int |
getPartProblemNumber()
Get the maximum number of problem parts.
|
int |
getPartProblemSize()
Get the maximum size for part of a problem.
|
boolean |
getResultsBetter()
Return true if the current set of results are better than the previous
set of results.
|
org.licas_xml.abs.Element |
getResultXml()
Get the results of the test.
|
int |
getWholeProblemSize()
Get the maximum size for a whole problem.
|
java.util.HashMap<java.lang.String,?> |
randomiseHashtableOrder(java.util.HashMap toRandomise)
Randomise the order of the entries in the hashtable.
|
boolean |
resetForNextRun(java.util.HashMap varList)
Reset the problem-solving structures for the next run.
|
void |
resetValues()
Reset to starting values
|
void |
restorePreviousSolutionSet(boolean randomise)
Rollback to the previous solution set.
|
void |
setMaxSolutionsNumber(int thisMaxSolutionsNumber)
Set the maximum allowed number of solutions.
|
void |
setPartProblemNumber(int thisPartProblemNumber)
Set the maximum number of problem parts.
|
void |
setPartProblemSize(int thisPartProblemSize)
Set the maximum size for part of a problem.
|
void |
setWholeProblemSize(int thisWholeProblemSize)
Set the maximum size for a whole problem.
|
protected void |
sortProblems(TestSpec testSpec,
boolean reOrder)
Try to (re)sort the problem list after making appropriate changes.
|
firstSolutionsAndProblems
solutionsToProcess
createStoreData, getProblemsList, getSolutionHierarchy, hasSolutions, readData
addHeuristicOption, clearHeuristicOptions, getFullTrace, getHeuristicOptions, getHeuristicType, getProblem, getProblemNames, getSolutionSet, getSolutionsNumber, getTestEnded, processResult, setDatasetType, setFullTrace, setHeuristicOptions, setHeuristicType, setProblem, setSolutionSet, setSolutionsNumber
getDatasetType, getDirFolder, getTokenizer, parseProblemDataset, setDirFolder, setTokenizer, validateScript, validateVariable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createNewSolution
updateSolutions
solve
protected EvalBounds intermediateBounds
protected java.lang.Object currentOptValue
protected java.lang.Object bestOptValue
protected int maxSolutionsNumber
protected int wholeProblemSize
protected int partProblemSize
protected int partProblemNumber
protected MatchResult lastGridSolution
public GridProblemMediator(org.licas.PasswordHandler thePasswordHandler)
thePasswordHandler
- for storing passwords.public void resetValues()
resetValues
in class IterateMediatorCentral
public void copyToConfig(TestSpec testSpec) throws java.lang.Exception
copyToConfig
in interface ProblemMediatorDef
copyToConfig
in class ProblemMediator
testSpec
- the model of the tests to perform.java.lang.Exception
- any error.protected void sortProblems(TestSpec testSpec, boolean reOrder) throws java.lang.Exception
testSpec
- the test specification describing the test run.reOrder
- true if randomise the ordering for the next test iteration.java.lang.Exception
- any error.public boolean resetForNextRun(java.util.HashMap varList) throws java.lang.Exception
resetForNextRun
in class ProblemMediator
varList
- a list of variables as key-value pairs. Needs to include the test spec.java.lang.Exception
- any error.public void restorePreviousSolutionSet(boolean randomise) throws java.lang.Exception
randomise
- if true also randomise the new solutions in the previous
solution set with regard to their positions.java.lang.Exception
- any error.protected boolean calcResultsBetter(MatchResult solutionSet) throws java.lang.Exception
solutionSet
- the solution set to evaluate.java.lang.Exception
- any error.protected void calcTestEnded(MatchResult solutionSet) throws java.lang.Exception
calcTestEnded
in class IterateMediatorCentral
solutionSet
- the last solution set to evaluate.java.lang.Exception
- any error.public org.licas_xml.abs.Element getResultXml() throws java.lang.Exception
java.lang.Exception
- any error.public java.util.HashMap<java.lang.String,?> randomiseHashtableOrder(java.util.HashMap toRandomise)
toRandomise
- the hashtable to randomise.public void setMaxSolutionsNumber(int thisMaxSolutionsNumber)
thisMaxSolutionsNumber
- the maximum number of solutions.public int getMaxSolutionsNumber()
public void setWholeProblemSize(int thisWholeProblemSize)
thisWholeProblemSize
- the maximum size for a whole problem.public int getWholeProblemSize()
public void setPartProblemSize(int thisPartProblemSize)
thisPartProblemSize
- the maximum size for a problem part.public int getPartProblemSize()
public void setPartProblemNumber(int thisPartProblemNumber)
thisPartProblemNumber
- the maximum number of problem parts.public int getPartProblemNumber()
public boolean getResultsBetter()
getResultsBetter
in interface IterateMediatorDef
getResultsBetter
in class IterateMediatorCentral