Package org.jacop.examples.fd
Class Golomb
java.lang.Object
org.jacop.examples.fd.ExampleFD
org.jacop.examples.fd.Golomb
It models a Golomb ruler problem.
- Version:
- 4.9
Golomb ruler is a special sequence of natural numbers an example is 0 1 4 6
a sequence is a Golomb ruler if all differences are different (1-0), (4-0), (6-0), (4-1), (6-1), (6-4) 1 4 6 3 5 2 All differences above have different values A Golomb ruler is optimal if the length of it (the last mark) has the smallest possible value The presented ruler with 4 marks of length 6 is optimal
-
Field Summary
FieldsModifier and TypeFieldDescriptionint
It specifies the upper bound of the optimal solution.int
It specifies the number of marks (number of natural numbers in the sequence).It contains all differences between all possible pairs of marks. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
It executes the program which computes the optimal Golomb ruler.void
model()
It specifies a standard way of modeling the problem.boolean
It specifies specific search for the optimal solution search procedure, which printouts intermediate search results and shows how the search is progressing.static void
It executes the program which first computes the optimal Golomb ruler.Methods inherited from class org.jacop.examples.fd.ExampleFD
creditSearch, getSearch, getSearchVariables, getStore, printMatrix, search, searchAllAtOnce, searchAllOptimal, searchLDS, searchMasterSlave, searchMaxRegretOptimal, searchMiddle, searchMostConstrainedStatic, searchOptimal, searchSmallestDomain, searchSmallestMedian, searchSmallestMiddle, searchSmallestMin, searchWeightedDegree, searchWithMaxRegret, searchWithRestarts, shavingSearch
-
Field Details
-
noMarks
public int noMarksIt specifies the number of marks (number of natural numbers in the sequence). -
bound
public int boundIt specifies the upper bound of the optimal solution. -
subs
It contains all differences between all possible pairs of marks.
-
-
Constructor Details
-
Golomb
public Golomb()
-
-
Method Details
-
model
public void model()Description copied from class:ExampleFD
It specifies a standard way of modeling the problem. -
searchOptimalInfo
public boolean searchOptimalInfo()It specifies specific search for the optimal solution search procedure, which printouts intermediate search results and shows how the search is progressing.- Returns:
- true if the (optimal) solution is found, false if no solution found.
-
main
It executes the program which computes the optimal Golomb ruler.- Parameters:
args
- the first argument specifies the number of marks, the second argument specifies the upper bound of the optimal solution.
-
test
It executes the program which first computes the optimal Golomb ruler. Afterwards, it computes all the optimal solutions but it does not use previously established cost of the optimal solution.- Parameters:
args
- the first argument specifies the number of marks, the second argument specifies the upper bound of the optimal solution.
-