Class Zebra
- java.lang.Object
-
- org.jacop.examples.fd.ExampleFD
-
- org.jacop.examples.fd.Zebra
-
public class Zebra extends ExampleFD
It models and solves Zebra logic puzzle.- Version:
- 4.7
It was given at The German Institute of Logical Thinking in Berlin, 1981. And 98% FAILED.
Conditions
1. The Englishman lives in the red house. 2. The Spaniard owns a dog. 3. The Japanese is a painter. 4. The Italian drinks tea. 5. The Norwegian lives in the first house on the left. 6. The owner of the green house drinks coffee. 7. The green house is on the right of the white one. 8. The sculptor breeds snails. 9. The diplomat lives in the yellow house. 10. Milk is drunk in the middle house. 11. The Norwegian's house is next to the blue one. 12. The violinist drinks fruit juice. 13. The fox is in a house next to that of the doctor. 14. The horse is in a house next to that of the diplomat. Q. Who owns a Zebra, and who drinks water?
They sometimes smoke different brands of cigarettes too, but that's apparently no longer politically correct, so they all quit.
-
-
Constructor Summary
Constructors Constructor Description Zebra()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
main(java.lang.String[] args)
It executes the program to solve this simple logic puzzle.void
model()
It specifies a standard way of modeling the problem.-
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
-
-
-
-
Method Detail
-
model
public void model()
Description copied from class:ExampleFD
It specifies a standard way of modeling the problem.
-
main
public static void main(java.lang.String[] args)
It executes the program to solve this simple logic puzzle.- Parameters:
args
- no argument is used.
-
-