org.jacop.examples.fd

## Class SleepingArrangements

• ```public class SleepingArrangements
extends ExampleFD```
It is a simple logic puzzle about sleeping arrangements.
Version:
4.9

The Dillies have five teenaged children, two boys named Ollie and Rollie, and three girls named Mellie, Nellie, and Pollie. Each is a different number of years old, from 13 to 17. There are three bedrooms for the children in the Dillie house, so two share the yellow room, two share the white room, and one alone has the smaller green room. Can you match each one's name and age, and tell who sleeps where?

1. No one shares a room with a sibling of the opposite sex.

2. Pollie is exactly one year older than Mellie.

3. The two teenagers who share the yellow room are two years apart in age.

4. The two who share the white room are three years apart in age.

5. Rollie is somewhat older than Ollie, but somewhat younger than the sibling who has the green room.

Determine: Child -- Age -- Room

Given solution :

Mellie, 16, green room Nellie, 14, white room Ollie, 13, yellow room Pollie, 17, white room Rollie, 15, yellow room

Author:

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

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

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

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

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

• #### SleepingArrangements

`public SleepingArrangements()`
• ### 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 a program to solve this simple logic puzzle.
Parameters:
`args` - no arguments are used.