Package org.jacop.examples.fd
Class WolfGoatCabbage
java.lang.Object
org.jacop.examples.fd.ExampleFD
org.jacop.examples.fd.WolfGoatCabbage
A simple logic problem of transporting wolf, goat, and cabbage over the river.
- Version:
- 4.8
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 !
-
Field Summary
FieldsModifier and TypeFieldDescriptionint
It specifies number of moves allowed (one move is from one river bank to the other) -
Constructor Summary
Constructors -
Method Summary
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
-
Field Details
-
numberInnerMoves
public int numberInnerMovesIt specifies number of moves allowed (one move is from one river bank to the other)
-
-
Constructor Details
-
WolfGoatCabbage
public WolfGoatCabbage()
-
-
Method Details
-
model
public void model()Description copied from class:ExampleFD
It specifies a standard way of modeling the problem. -
main
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.
-