|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
AbstractClasses.ProblemDomain
public abstract class ProblemDomain
Problem domain is an abstract class containing methods for applying heuristics and managing solutions. These methods are used by a hyper-heuristic in order to progress the search. Sub-classes of ProblemDomain provide the representations of the various problem domains for the competition.
Nested Class Summary | |
---|---|
static class |
ProblemDomain.HeuristicType
An enumeration of the different types of low-level heuristics implemented in the software. |
Field Summary | |
---|---|
protected double |
depthOfSearch
A parameter specifying the extent to which a local search heuristic will modify the solution. |
protected int[] |
heuristicCallRecord
A record of the number of times that each low level heuristic has been called. |
protected int[] |
heuristicCallTimeRecord
A record of the length of time that each low level heuristic has been running for. |
protected double |
intensityOfMutation
A parameter specifying the extent to which a mutation or ruin-recreate low level heuristic will mutate the solution. |
protected java.util.Random |
rng
The random number generator used by the problem domain object. |
Constructor Summary | |
---|---|
ProblemDomain(long seed)
Creates a new problem domain and creates a new random number generator using the seed provided. |
Method Summary | |
---|---|
abstract double |
applyHeuristic(int heuristicID,
int solutionSourceIndex, int solutionDestinationIndex)
Applies the heuristic specified by heuristicID to the solution at position solutionSourceIndex and places the resulting solution at position solutionDestinationIndex in the solution array. |
abstract double |
applyHeuristic(int heuristicID,
int solutionSourceIndex1, int solutionSourceIndex2,
int solutionDestinationIndex)
Apply the heuristic specified by heuristicID to the solutions at position solutionSourceIndex1 and position solutionSourceIndex2 and put the resulting solution at position solutionDestinationIndex. |
abstract java.lang.String |
bestSolutionToString()
Gets a String representation of the best solution found so far by the HyperHeuristic. |
abstract boolean |
compareSolutions(int solutionIndex1,
int solutionIndex2)
Compares the two solutions on their structure (i.e. in the solution space, not in the objective/fitness function space). |
abstract void |
copySolution(int solutionSourceIndex,
int solutionDestinationIndex)
Copies a solution from one position in the solution array to another |
abstract double |
getBestSolutionValue()
Returns the objective function value of the best solution found so far by the HyperHeuristic. |
double |
getDepthOfSearch()
Gets the current value of the "depth of search" parameter. |
abstract double |
getFunctionValue(int solutionIndex)
Gets the objective function value of the solution at index solutionIndex |
int[] |
getHeuristicCallRecord()
Shows how many times each low level heuristic has been called. |
int[] |
getheuristicCallTimeRecord()
Shows the total time that each low level heuristic has been operating on the problem. |
abstract int[] |
getHeuristicsOfType(ProblemDomain.HeuristicType heuristicType)
Gets an array of heuristicIDs of the type specified by heuristicType. |
abstract int[] |
getHeuristicsThatUseDepthOfSearch()
Gets an array of heuristicIDs that use the depthOfSearch parameter |
abstract int[] |
getHeuristicsThatUseIntensityOfMutation()
Gets an array of heuristicIDs that use the intensityOfMutation parameter |
double |
getIntensityOfMutation()
Gets the current intensity of mutation parameter. |
abstract int |
getNumberOfHeuristics()
Gets the number of heuristics available in this problem domain |
abstract int |
getNumberOfInstances()
Gets the number of instances available in this problem domain |
abstract void |
initialiseSolution(int index)
Create an initial solution at a specified position in the memory array. |
abstract void |
loadInstance(int instanceID)
Loads the instance specified by instanceID. |
void |
setDepthOfSearch(double depthOfSearch)
Sets the parameter specifying the extent to which a local search heuristic will modify the solution. |
void |
setIntensityOfMutation(double intensityOfMutation)
Sets the parameter specifying the extent to which a mutation or ruin-recreate low level heuristic will mutate the solution. |
abstract void |
setMemorySize(int size)
Sets the size of the array where the solutions are stored. |
abstract java.lang.String |
solutionToString(int solutionIndex)
Gets a String representation of a given solution in memory |
abstract java.lang.String |
toString()
Gets the name of the problem domain. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify,
notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.Random rng
protected double depthOfSearch
protected double intensityOfMutation
protected int[] heuristicCallRecord
protected int[] heuristicCallTimeRecord
Constructor Detail |
---|
public ProblemDomain(long seed)
seed
- a random seedMethod Detail |
---|
public int[] getHeuristicCallRecord()
public int[] getheuristicCallTimeRecord()
public void setDepthOfSearch(double depthOfSearch)
depthOfSearch
- must be in the range 0 to 1. The
initial value of 0.1 represents the default operation of the low level
heuristic.public void setIntensityOfMutation(double intensityOfMutation)
intensityOfMutation
- must be in the range 0 to
1. The initial value of 0.1 represents the default operation of the low
level heuristic.public double getDepthOfSearch()
public double getIntensityOfMutation()
public abstract int[] getHeuristicsOfType(ProblemDomain.HeuristicType heuristicType)
heuristicType
- the heuristic type.
public abstract int[] getHeuristicsThatUseIntensityOfMutation()
public abstract int[] getHeuristicsThatUseDepthOfSearch()
public abstract void loadInstance(int instanceID)
instanceID
- Specifies the instance to load. The
ID's start at zero.public abstract void setMemorySize(int size)
size
- The new size of the solution array.public abstract void initialiseSolution(int index)
index
- The index of the memory array at which
the solution should be initialised.public abstract int getNumberOfHeuristics()
public abstract double applyHeuristic(int heuristicID,
int solutionSourceIndex,
int solutionDestinationIndex)
heuristicID
- The ID of the heuristic to apply
(starts at zero)solutionSourceIndex
- The index of the solution
in the memory array to which to apply the heuristicsolutionDestinationIndex
- The index in the
memory array at which to store the resulting solution
public abstract double applyHeuristic(int heuristicID,
int solutionSourceIndex1,
int solutionSourceIndex2,
int solutionDestinationIndex)
heuristicID
- the heuristic to apply (starts at
zero)solutionSourceIndex1
- solutionSourceIndex2
- solutionDestinationIndex
- the position to store
the resulting solutions at
public abstract void copySolution(int solutionSourceIndex,
int solutionDestinationIndex)
solutionSourceIndex
- The position of the
solution to copysolutionDestinationIndex
- The position in the
array to copy the solution to.public abstract java.lang.String toString()
toString
in class java.lang.Object
public abstract int getNumberOfInstances()
public abstract java.lang.String bestSolutionToString()
public abstract double getBestSolutionValue()
public abstract java.lang.String solutionToString(int solutionIndex)
solutionIndex
- The index of the solution of
which a String representation is required
public abstract double getFunctionValue(int solutionIndex)
solutionIndex
- The index of the solution from
which the objective function is required
public abstract boolean compareSolutions(int solutionIndex1,
int solutionIndex2)
solutionIndex1
- solutionIndex2
-
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |