Class FourIslands
- java.lang.Object
-
- org.jacop.examples.fd.ExampleFD
-
- org.jacop.examples.fd.FourIslands
-
public class FourIslands extends ExampleFD
It is a very simple puzzle about islands and bridges.- Version:
- 4.7
A tiny nation in the South Pacific contains four islands connected by bridges as shown (see below). Each of the four islands (Pwana, Quero, Rayou, and Skern) boasts a different primary export (alabaster, bananas, coconuts, and durian fruit) and a different tourist attraction (hotel, ice skating rink, jai alai stadium, and koala preserve). Can you find the name, export, and tourist attraction of each island on the map?
N W E *compass directions S
A, B, C, D are the islands
(A) -- (B) | | | | (C) -- (D)
(view with non-proportional font) 1. The island noted for its koala preserve is due south of Pwana.
2. The island with the largest alabaster quarry is due west of Quero.
3. The island with the resort hotel is due east of the one that exports durian fruit.
4. Skern and the island with the jai alai stadium are connected by a north-south bridge.
5. Rayou and the island that exports bananas are connected by an east-west bridge.
6. The islands noted for the South Pacific's largest ice skating rink and for the jai alai stadium are not connected by a bridge.
Determine: Island location -- Island name -- Export -- Tourist Attraction
ANSWER: Northwest, Pwana, durian fruit, ice skating rink Northeast, Skern, coconuts, hotel Southwest, Rayou, alabaster, koala preserve Southeast, Quero, bananas, jai alai stadium
-
-
Constructor Summary
Constructors Constructor Description FourIslands()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
main(java.lang.String[] args)
It executes a 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 a program to solve this simple logic puzzle.- Parameters:
args
- no argument is used.
-
-