ExamplesJaCoP
Class Zebra

java.lang.Object
  extended by ExamplesJaCoP.Example
      extended by ExamplesJaCoP.Zebra

public class Zebra
extends Example

It models and solves Zebra logic puzzle.

Author:
Radoslaw Szymanek 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.

Field Summary
 
Fields inherited from class ExamplesJaCoP.Example
cost, search, store, vars
 
Constructor Summary
Zebra()
           
 
Method Summary
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 ExamplesJaCoP.Example
creditSearch, getSearch, getSearchVariables, getStore, printMatrix, search, searchAllAtOnce, searchAllOptimal, searchLDS, searchMasterSlave, searchMaxRegretOptimal, searchMiddle, searchMostConstrainedStatic, searchOptimal, searchSmallestDomain, searchSmallestMedian, searchSmallestMiddle, searchSmallestMin, searchWeightedDegree, searchWithMaxRegret, searchWithRestarts, shavingSearch
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Zebra

public Zebra()
Method Detail

model

public void model()
Description copied from class: Example
It specifies a standard way of modeling the problem.

Specified by:
model in class Example

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.