Hey java maties
(srry if my english is bad, but it's not my motherlanguage)
I need a program that simulates the life in a beehive. I have a few problems with it:
The user can give in a certain amount of queens, worker bees and drones (and this results in a certain amount of bees).
A worker bee can have a certain amount of soft nectar (2 food units) or unsoft nectar (1 food unit) (the user gives the amounts...)
The beehive is just a matrix, length and width also given by the user. We may use a class named ActionChooser. 1 method in that class is called:
public int chooseAction(boolean barray). '
Barray' is an array with a length of 16 (actions) which can be resolved (true) of not resolved (false). The method chooseAction gives, as a result, the number of an action (and -1 if no action can be resolved).
Actions 4,5,6,7,8 and 9 are always false (don't bother).
action 0: a bee of the total amount of bees goes northward. In this program a bee doesn't die or can leave the beehive (= the matrix). So, there are a few conditions (f.e. a bee is on the northern side of teh matrix, the bee cannot go northward AND if in the section above the bee, the max. amount of bees(given by the user) has reached, the bee cannot go northward either)
action 1: go westward (same conditions)
action 2: southward (idem)
action 3: eastward (idem)
action 10: when 1 bee (of the total number of bees) is in the underrightcorner, that bee disappears. However a queen cannot disappear AND a worker bee that still has an amount of food units cannot disappear as well...
action 11: a worker bee can drop 1 food unit (soft or unsoft nectar, doesn't mather which of the 2). However, if the max. amount of food units in that section has reached (again given by the user), the action cannot be resolved...
Don't bother the other actions...