ExamplesJaCoP
Class WolfGoatCabbage

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

public class WolfGoatCabbage
extends Example

A simple logic problem of transporting wolf, goat, and cabbage over the river.

Author:
Radoslaw Szymanek 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
 int numberInnerMoves
          It specifies number of moves allowed (one move is from one river bank to the other)
 
Fields inherited from class ExamplesJaCoP.Example
cost, search, store, vars
 
Constructor Summary
WolfGoatCabbage()
           
 
Method Summary
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 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
 

Field Detail

numberInnerMoves

public int numberInnerMoves
It specifies number of moves allowed (one move is from one river bank to the other)

Constructor Detail

WolfGoatCabbage

public WolfGoatCabbage()
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 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.