|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.drools.examples.manners.MannersBase
Miss Manners is a program which handles the problem of finding an acceptable seating arrangement for guests at a dinner party. It will attempt to match people with the same hobbies, and to seat everyone next to a member of the opposite sex. Manners is a small program, which has only few rules, and employs a depth-first search approach to the problem.
Field Summary | |
protected int |
maxHobbies
Maximun number of hobbies each guest should have (default: 3). |
protected int |
minHobbies
Minimum number of hobbies each guest should have (default: 2). |
protected int |
numGuests
Number of guests at the dinner (default: 16). |
protected int |
numSeats
Number of seats at the table (default: 16). |
protected java.lang.String |
ruleUri
URI of file containing rule-set (default: 'manners.java.drl'). |
Constructor Summary | |
protected |
MannersBase(java.lang.String[] args)
|
Method Summary | |
protected java.io.InputStream |
generateData()
|
protected java.util.List |
getInputObjects(java.io.InputStream inputStream)
Convert the facts from the InputStream to a list of
objects. |
protected void |
run()
|
protected abstract void |
setUp()
Setup the test case. |
protected abstract void |
tearDown()
Tear down the test case. |
protected abstract java.util.List |
test(java.util.List inList)
Just do it. |
protected static int |
validateResults(java.util.List inList,
java.util.List outList)
Verify that each guest has at least one common hobby with the guest before him/her. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.String ruleUri
protected int numGuests
protected int numSeats
protected int minHobbies
protected int maxHobbies
Constructor Detail |
protected MannersBase(java.lang.String[] args)
Method Detail |
protected void run() throws java.lang.Exception
java.lang.Exception
protected abstract void setUp() throws java.lang.Exception
java.lang.Exception
protected abstract void tearDown() throws java.lang.Exception
java.lang.Exception
protected abstract java.util.List test(java.util.List inList) throws java.lang.Exception
java.lang.Exception
protected static int validateResults(java.util.List inList, java.util.List outList)
protected java.util.List getInputObjects(java.io.InputStream inputStream) throws java.io.IOException
InputStream
to a list of
objects.
java.io.IOException
protected java.io.InputStream generateData()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |