Package org.jacop.examples.fd
Class WolfGoatCabbage
- java.lang.Object
-
- org.jacop.examples.fd.ExampleFD
-
- org.jacop.examples.fd.WolfGoatCabbage
-
public class WolfGoatCabbage extends ExampleFD
A simple logic problem of transporting wolf, goat, and cabbage over the river.- Version:
- 4.7
We need to transfer the cabbage, the goat and the wolf from one bank of the river to the other bank. But there is only one seat available on his boat !
Furthermore, if the goat and the cabbage stay together as we are leaving on a boat, the goat will eat the cabbage. And if the wolf and the goat stay together as we are leaving, the wolf will eat the goat !
-
-
Constructor Summary
Constructors Constructor Description WolfGoatCabbage()
-
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 which finds the optimal trip and load of the boat between the river banks so all parties survive.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 which finds the optimal trip and load of the boat between the river banks so all parties survive.- Parameters:
args
- no argument is used.
-
-