Author:halw

Date:2011-02-12T15:24:18.000000Z


git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@761 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
halw
2011-02-12 15:24:18 +00:00
parent a3465649c8
commit 7906a79b95

View File

@@ -15,5 +15,9 @@ The problem of the dining savages (an obvious allusion to the classic dining phi
=Highlights=
The primary shared resource here is the pot, represented by class <code>POT</code>. <code>POT</code> has queries <code>is_empty</code> and <code>is_full</code> that can be used by savages and the cook.
The primary shared resource here is the pot, represented by class <code>POT</code>. <code>POT</code> has queries <code>is_empty</code> and <code>is_full</code> that can be used by savages (modeled by class SAVAGE) and the cook (class COOK).
In the root class, one can adjust the number of savages, the size (in servings) of the pot, and how hungry the savages are. The hunger index indicates how many times a savage will take a serving from the pot and eat it before being sated. So if the pot holds 20 servings and there are 5 savages with hunger index of 4, then the pot will become empty just as the last savage takes his or her last serving. In the same scenario, if the hunger index were 10, then 50 servings total would be required, resulting in the need for the cook to be notified to refill the pot 2 times ... and 10 servings leftover ... presumably for tomorrow's breakfast.