|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectAbstractClasses.ProblemDomain
BinPacking.BinPacking
public class BinPacking
This class implements the Bin Packing 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 | |
|---|---|
BinPacking(long seed)
Constructs a new BinPacking object with a seed for the random number generator. |
|
| Method Summary | |
|---|---|
double |
applyHeuristic(int heuristicID,
int source,
int destination)
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 source1,
int source2,
int destination)
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 index)
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 |
setMemorySize(int size)
Sets the size of the array where the solutions are stored. |
java.lang.String |
solutionToString(int index)
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, setDepthOfSearch, setIntensityOfMutation |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public BinPacking(long seed)
seed - The seed for the random number generator.| Method Detail |
|---|
public int[] getHeuristicsThatUseDepthOfSearch()
ProblemDomain
getHeuristicsThatUseDepthOfSearch in class ProblemDomainpublic int[] getHeuristicsThatUseIntensityOfMutation()
ProblemDomain
getHeuristicsThatUseIntensityOfMutation in class ProblemDomainpublic void loadInstance(int instanceID)
ProblemDomain
loadInstance in class ProblemDomaininstanceID - Specifies the instance to load. The ID's
start at zero.public void initialiseSolution(int index)
ProblemDomain
initialiseSolution in class ProblemDomainindex - The index of the memory array at which the solution should be initialised.public int getNumberOfHeuristics()
ProblemDomain
getNumberOfHeuristics in class ProblemDomain
public double applyHeuristic(int heuristicID,
int source,
int destination)
ProblemDomain
applyHeuristic in class ProblemDomainheuristicID - The ID of the heuristic to apply (starts at zero)source - The index of the solution in the memory array to which to apply the heuristicdestination - The index in the memory array at which
to store the resulting solution
public double applyHeuristic(int heuristicID,
int source1,
int source2,
int destination)
ProblemDomain
applyHeuristic in class ProblemDomainheuristicID - the heuristic to apply (starts at zero)destination - the position to store the resulting
solutions at
public void copySolution(int source,
int destination)
ProblemDomain
copySolution in class ProblemDomainsource - The position of the solution to copydestination - The position in the array to copy the
solution to.public java.lang.String solutionToString(int index)
ProblemDomain
solutionToString in class ProblemDomainindex - The index of the solution of which a String representation is required
public java.lang.String bestSolutionToString()
ProblemDomain
bestSolutionToString in class ProblemDomainpublic double getFunctionValue(int index)
ProblemDomain
getFunctionValue in class ProblemDomainindex - The index of the solution from which the objective function is required
public double getBestSolutionValue()
ProblemDomain
getBestSolutionValue in class ProblemDomainpublic void setMemorySize(int size)
ProblemDomain
setMemorySize in class ProblemDomainsize - The new size of the solution array.public int getNumberOfInstances()
ProblemDomain
getNumberOfInstances in class ProblemDomainpublic java.lang.String toString()
ProblemDomain
toString in class ProblemDomain
public boolean compareSolutions(int solutionIndex1,
int solutionIndex2)
ProblemDomain
compareSolutions in class ProblemDomainpublic int[] getHeuristicsOfType(ProblemDomain.HeuristicType hType)
ProblemDomain
getHeuristicsOfType in class ProblemDomainhType - the heuristic type.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||