Class DollarAndTicket
- java.lang.Object
-
- org.jacop.examples.fd.ExampleFD
-
- org.jacop.examples.fd.DollarAndTicket
-
public class DollarAndTicket extends ExampleFD
It solves a simple logic puzzle - Dollar and Ticket problem.- Version:
- 4.8
Every year the Soccer Club has a raffle to support the cost of playing fields, equipment, and camps. This year the top five sellers were three girls named Diane, Jenny, and Maggie, and two boys named Greg and Kevin; last names are Borecki, Ott, Panos, Ruiz, and Vogel. Each of them is on a different team (the Bobcats, Cheetahs, Kickers, Stars, and Wolves), and each sold a different number of books of tickets (20, 18, 12, 10, and 6). Can you match each seller's full name with his or her team and number of ticket books sold?
1. Jenny sold exactly twice as many books as Ms. Ruiz. 2. The one who sold 12 books (who isn't Panos) isn't on the Bobcats or Stars. 3. The player from the Wolves sold at least twice as many books as Ott. 4. Borecki isn't on the Kickers. 5. The girl on the Cheetahs sold exactly three times as many books as Diane. 6. Greg isn't Borecki or Ott. 7. Kevin isn't on the Bobcats.
-
-
Constructor Summary
Constructors Constructor Description DollarAndTicket()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
main(java.lang.String[] args)
It executes the program to solve this simple 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 the program to solve this simple puzzle.- Parameters:
args
- no argument is used.
-
-