|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectAbstractClasses.ProblemDomain
SAT.SAT
public class SAT
This class implements the SAT problem domain.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class AbstractClasses.ProblemDomain |
---|
ProblemDomain.HeuristicType |
Field Summary |
---|
Fields inherited from class AbstractClasses.ProblemDomain |
---|
depthOfSearch, heuristicCallRecord, heuristicCallTimeRecord, intensityOfMutation, rng |
Constructor Summary | |
---|---|
SAT(long seed)
Constructs a new SAT object with a seed for the random number generator. |
Method Summary | |
---|---|
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. |
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. |
java.lang.String |
bestSolutionToString()
Gets a String representation of the best solution found so far by the HyperHeuristic. |
boolean |
compareSolutions(int solutionIndex1,
int solutionIndex2)
Compares two solutions in the memory for equality. |
void |
copySolution(int source,
int destination)
Copies a solution from one position in the solution array to another |
double |
getBestSolutionValue()
Returns the objective function value of the best solution found so far by the HyperHeuristic. |
double |
getFunctionValue(int solutionIndex)
Gets the objective function value of the solution at index solutionIndex |
int[] |
getHeuristicsOfType(ProblemDomain.HeuristicType hType)
Gets an array of heuristicIDs of the type specified by heuristicType. |
int[] |
getHeuristicsThatUseDepthOfSearch()
Gets an array of heuristicIDs that use the depthOfSearch parameter |
int[] |
getHeuristicsThatUseIntensityOfMutation()
Gets an array of heuristicIDs that use the intensityOfMutation parameter |
int |
getNumberOfHeuristics()
Gets the number of heuristics available in this problem domain |
int |
getNumberOfInstances()
Gets the number of instances available in this problem domain |
void |
initialiseSolution(int index)
Create an initial solution at a specified position in the memory array. |
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. |
void |
setMemorySize(int size)
Sets the size of the array where the solutions are stored. |
java.lang.String |
solutionToString(int solutionIndex)
Gets a String representation of a given solution in memory |
java.lang.String |
toString()
Gets the name of the problem domain. |
Methods inherited from class AbstractClasses.ProblemDomain |
---|
getDepthOfSearch, getHeuristicCallRecord, getheuristicCallTimeRecord, getIntensityOfMutation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SAT(long seed)
seed
- Method Detail |
---|
public void setDepthOfSearch(double depthOfSearch)
ProblemDomain
setDepthOfSearch
in class ProblemDomain
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)
ProblemDomain
setIntensityOfMutation
in class ProblemDomain
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 int getNumberOfHeuristics()
ProblemDomain
getNumberOfHeuristics
in class ProblemDomain
public double applyHeuristic(int heuristicID, int solutionSourceIndex, int solutionDestinationIndex)
ProblemDomain
applyHeuristic
in class ProblemDomain
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 double applyHeuristic(int heuristicID, int solutionSourceIndex1, int solutionSourceIndex2, int solutionDestinationIndex)
ProblemDomain
applyHeuristic
in class ProblemDomain
heuristicID
- the heuristic to apply (starts at zero)solutionDestinationIndex
- the position to store the resulting
solutions at
public java.lang.String bestSolutionToString()
ProblemDomain
bestSolutionToString
in class ProblemDomain
public void copySolution(int source, int destination)
ProblemDomain
copySolution
in class ProblemDomain
source
- The position of the solution to copydestination
- The position in the array to copy the
solution to.public double getBestSolutionValue()
ProblemDomain
getBestSolutionValue
in class ProblemDomain
public double getFunctionValue(int solutionIndex)
ProblemDomain
getFunctionValue
in class ProblemDomain
solutionIndex
- The index of the solution from which the objective function is required
public int[] getHeuristicsOfType(ProblemDomain.HeuristicType hType)
ProblemDomain
getHeuristicsOfType
in class ProblemDomain
hType
- the heuristic type.
public int[] getHeuristicsThatUseDepthOfSearch()
ProblemDomain
getHeuristicsThatUseDepthOfSearch
in class ProblemDomain
public int[] getHeuristicsThatUseIntensityOfMutation()
ProblemDomain
getHeuristicsThatUseIntensityOfMutation
in class ProblemDomain
public int getNumberOfInstances()
ProblemDomain
getNumberOfInstances
in class ProblemDomain
public void initialiseSolution(int index)
ProblemDomain
initialiseSolution
in class ProblemDomain
index
- The index of the memory array at which the solution should be initialised.public void loadInstance(int instanceID)
ProblemDomain
loadInstance
in class ProblemDomain
instanceID
- Specifies the instance to load. The ID's
start at zero.public void setMemorySize(int size)
ProblemDomain
setMemorySize
in class ProblemDomain
size
- The new size of the solution array.public java.lang.String solutionToString(int solutionIndex)
ProblemDomain
solutionToString
in class ProblemDomain
solutionIndex
- The index of the solution of which a String representation is required
public java.lang.String toString()
ProblemDomain
toString
in class ProblemDomain
public boolean compareSolutions(int solutionIndex1, int solutionIndex2)
ProblemDomain
compareSolutions
in class ProblemDomain
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |