org.jacop.examples.fd

## Class Zebra

• ```public class Zebra
extends ExampleFD```
It models and solves Zebra logic puzzle.
Version:
4.8

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.

Author:

• ### Fields inherited from class org.jacop.examples.fd.ExampleFD

`cost, search, store, vars`
• ### Constructor Summary

Constructors
Constructor and Description
`Zebra()`
• ### Method Summary

All Methods
Modifier and Type Method and Description
`static void` `main(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`
• ### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Constructor Detail

• #### Zebra

`public Zebra()`
• ### Method Detail

• #### model

`public void model()`
Description copied from class: `ExampleFD`
It specifies a standard way of modeling the problem.
Specified by:
`model` in class `ExampleFD`
• #### main

`public static void main(String[] args)`
It executes the program to solve this simple logic puzzle.
Parameters:
`args` - no argument is used.