Results 1 to 3 of 3
  1. #1
    BlueF4re is offline Member
    Join Date
    Nov 2009
    Posts
    2
    Rep Power
    0

    Exclamation beehive simulation

    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...

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by BlueF4re View Post
    Hey java maties
    (srry if my english is bad, but it's not my motherlanguage)
    You're English is quite fine. Not to worry about this.

    I need a program that simulates the life in a beehive.
    And we wish you great success with this.

    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). ...
    So here you list the assignment but don't mention any of your specific problems. Of course we can't help you until you do this. Otherwise to just dump the assignment here without further comment is what is known as a "homework dump" and is looked down upon. I look forward to more info from you and perhaps a post of the code that you've done so far, and what is not working right.

    Much luck and welcome to the forum!
    Last edited by Fubarable; 12-02-2009 at 12:06 AM.

  3. #3
    BlueF4re is offline Member
    Join Date
    Nov 2009
    Posts
    2
    Rep Power
    0

    Default

    Well

    I actually don't know how to let a random bee move. The conditions are no problem. I thought of using 'setters' and putting the drones, queens and worker bees in an array, bu that's it.

    You' ve got the beehive[i][j] and if want to let a random bee go northward, you have to 'set' that bee in the section beehive[i][j+1]. But you can't just say "bee[k] = beehive[i][j+1]" That is impossible. So I need avice about how to use the number of bees, queens, drones etc. and which method I need for getting a bee in a different section (1 is enough; if I see the method I will understand how to let a bee go eastward, westward etc...)

Similar Threads

  1. Back-Forward Simulation using stacks(java)
    By MarKus in forum New To Java
    Replies: 3
    Last Post: 09-10-2008, 02:47 PM
  2. Mars Simulation Project 2.84
    By Java Tip in forum Java Software
    Replies: 0
    Last Post: 06-26-2008, 07:18 PM
  3. Pulley Simulation..HELP
    By dazza-s in forum Java 2D
    Replies: 2
    Last Post: 06-18-2008, 11:51 PM
  4. Small tennis simulation in Java
    By diego in forum New To Java
    Replies: 1
    Last Post: 12-02-2007, 02:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •