Class MasterClass
- java.lang.Object
-
- org.jacop.examples.fd.ExampleFD
-
- org.jacop.examples.fd.MasterClass
-
public class MasterClass extends ExampleFD
It solves a logic puzzle about singing women.- Version:
- 4.7
The great mezzo-soprano Flora Nebbiacorno has retired from the international opera stage, but she still teaches master classes regularly. At a recent class, her five students were one soprano, one mezzo-soprano, two tenors, and one bass. (The first two voice types are women's, and the last two are men's). Their first names are Chris, J.P., Lee, Pat, and Val -- any of which could belong to a man or a woman - - and their last names are Kingsley, Robinson, Robinson (the two are unrelated but have the same last name), Ulrich, and Walker. Can you find the order in which these five sang for the class, identifying each by full name and voice type?
1. The first and second students were, in some order, Pat and the bass.
2. The second and third students included at least one tenor.
3. Kingsley and the fifth student (who isn't named Robinson) were, in some order, a mezzo-soprano and a tenor.
4. Neither the third student, whose name is Robinson, nor Walker has the first name of Chris.
5. Ulrich is not the bass or the mezzo-soprano.
6. Neither Lee or Val (who wasn't third) is a tenor.
7. J.P. wasn't third, and Chris wasn't fifth.
8. The bass isn't named Robinson.
Determine: Order -- First name -- Last name -- Voice
-
-
Constructor Summary
Constructors Constructor Description MasterClass()
-
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 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 the program to solve this simple logic puzzle.- Parameters:
args
- no arguments is used.
-
-