public class GeneticGridProblemMediator extends GridProblemMediator
Modifier and Type | Field and Description |
---|---|
protected float |
crossoverFraction
The amount of gene to crossover for an evolution.
|
protected float |
mutateFraction
The amount of gene to mutate for an evolution.
|
bestOptValue, currentOptValue, intermediateBounds, lastGridSolution, maxSolutionsNumber, partProblemNumber, partProblemSize, wholeProblemSize
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 |
---|
GeneticGridProblemMediator(org.licas.PasswordHandler thePasswordHandler)
Create a new instance of GeneticGridProblemMediator.
|
Modifier and Type | Method and Description |
---|---|
Solution |
createNewSolution(java.lang.String solutionType,
org.ai_heuristic.eval.metric.MetricDataset problemDataset)
Create a new genetic solution with chromosomes, etc.
|
float |
getCrossoverFraction()
Get the fraction of gene to crossover with another gene.
|
float |
getMutateFraction()
Get the fraction of gene to mutate with another gene.
|
void |
setCrossoverFraction(float thisCrossoverFraction)
Set the fraction of gene to crossover with another gene.
|
void |
setMutateFraction(float thisMutateFraction)
Set the fraction of gene to mutate with another gene.
|
Result |
solve(TestSpec testSpec)
Optimise the solutions using the appropriate framework.
|
boolean |
updateSolutions(Result result)
This can be used to combine existing solutions to evolve new ones.
|
calcResultsBetter, calcTestEnded, copyToConfig, getMaxSolutionsNumber, getPartProblemNumber, getPartProblemSize, getResultsBetter, getResultXml, getWholeProblemSize, randomiseHashtableOrder, resetForNextRun, resetValues, restorePreviousSolutionSet, setMaxSolutionsNumber, setPartProblemNumber, setPartProblemSize, setWholeProblemSize, sortProblems
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
protected float crossoverFraction
protected float mutateFraction
public GeneticGridProblemMediator(org.licas.PasswordHandler thePasswordHandler)
thePasswordHandler
- for storing passwords.public Result solve(TestSpec testSpec) throws java.lang.Exception
testSpec
- the model of the tests to perform.java.lang.Exception
- any error.public Solution createNewSolution(java.lang.String solutionType, org.ai_heuristic.eval.metric.MetricDataset problemDataset) throws java.lang.Exception
Integer
, Float
, or
String
, primarily for testing purposes only.solutionType
- the type of solution to create.problemDataset
- the problem dataset to create the solution with.java.lang.Exception
- any error.public boolean updateSolutions(Result result) throws java.lang.Exception
heuristicOptions
object.
If this is empty, then it will create two new types - one through crossover and one
through mutation. If heuristicOptions specifies specific types on evolution, then it
will perform those only. It then tries to space the new solutions around the existing
solutions for the new grid structure.result
- the result generated by the problem solver.
Can be more solutions, references, or an error..java.lang.Exception
- any error.public void setCrossoverFraction(float thisCrossoverFraction)
thisCrossoverFraction
- the fraction of gene to crossover.public float getCrossoverFraction()
public void setMutateFraction(float thisMutateFraction)
thisMutateFraction
- the fraction of gene to mutate.public float getMutateFraction()