org.jacop.examples.fd

## Class Flowers

• ```public class Flowers
extends ExampleFD```
It is quite complex logic puzzle about flowers.
Version:
4.9

Each of four women in our office was delighted to receive a floral delivery at her desk this month. Each of the women (Emma, Kristin, Lynn, and Toni) received flowers from her husband (Doug, Justin, Shane, or Theo) for a different special occasion. Each bouquet consisted of a different type of flower, and each was delivered during the first four weeks of February. From the following clues, can you match each woman with her husband and determine the date on which each woman received flowers, the occasion for the flowers, and the type of flowers in each bouquet?

Calendar for February

Mon Tue Wed Thu Fri - 1 2 3 4 7 8 9 10 11 14 15 16 17 18 21 22 23 24 25

1. No two women received flowers on the same day of the week, and no two received flowers during the same week.

2. The woman who received flowers for Valentine's Day had them delivered on either Friday the 11th or Monday the 14th.

3. Emma received flowers one day later in the week than the woman who received flowers to celebrate a promotion.

4. Lynn received flowers either the week before or the week after the woman who received violets.

5. Justin's wife received flowers on either Monday the 7th (in which case she is the one who received white roses) or on Thursday the 24th (in which case she is the woman who received flowers to celebrate her birthday).

6. Theo's wife didn't receive flowers exactly eight days before the woman who received chrysanthemums.

7. Toni's husband is either Doug or Shane.

8. One woman received either chrysanthemums or white roses for her wedding anniversary.

9. Kristin received flowers on either Tuesday the 1st (in which case she is the one who received daisies) or Friday the 18th (in which case she received them from Doug).

10. Shane's wife received flowers during the second week of the month.

Determine: woman, husband, date, occasion, type of flowers

Author:
Tomasz Szwed, Wojciech Krupa, and Radoslaw Szymanek

• ### Fields inherited from class org.jacop.examples.fd.ExampleFD

`cost, search, store, vars`
• ### Constructor Summary

Constructors
Constructor and Description
`Flowers()`
• ### Method Summary

All Methods
Modifier and Type Method and Description
`static void` `main(String[] args)`
It executes the program which solves this 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`
• ### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Constructor Detail

• #### Flowers

`public Flowers()`
• ### Method Detail

• #### model

`public void model()`
Description copied from class: `ExampleFD`
It specifies a standard way of modeling the problem.
Specified by:
`model` in class `ExampleFD`
• #### main

`public static void main(String[] args)`
It executes the program which solves this logic puzzle.
Parameters:
`args` - no argument is used.