Results 1 to 2 of 2
  1. #1
    startoverIT is offline Member
    Join Date
    May 2016
    Posts
    2
    Rep Power
    0

    Default Sorting and Mixing

    Hi, I am developing a model to simulate a farm. A farm would have multiple barns to house chickens, all the chickens in one barn would arrive on the same day but different barns would be filled at different time. So if there are 10 barns at this farm,

    Barn 1: chickens in the barn would be there for 65 days
    Barn 2: chickens in the barn would be there for 60 days
    Barn 3: chickens in the barn would be there for 55 days
    Barn 4: chickens in the barn would be there for 40 days
    Barn 5: chickens in the barn would be there for 35 days
    etc.

    When barns of chickens have been there for ~ 65 days (+/- 5 days), then the chickens in each barn would be sorted by weight into 3 groups (low weight, medium weight, high weight) and re-group, so the first 3 barns satisfy the ~ 65 days condition

    Barn 1 (65 days): L1, M1, H1
    Barn 2 (60 days): L2, M2, H2
    Barn 3 (55 days): L3, M3, H3

    After sorting,

    Barn 1: L1, L2, L3
    Barn 2: M1, M2, M3
    Barn 3: H1, H2, H3

    I hope this makes sense. I have no idea how to approach this. Please help. Thank you so much.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,003
    Rep Power
    33

    Default Re: Sorting and Mixing

    Make a list of the steps the code needs to do to solve the problem.
    Some of the steps may require further work, but can be left for now.
    The main thing is to lay out the logic needed to solve the problem.
    Work on the steps you have one at a time. Write the code, compile, fix errors and repeat. Then execute to see if there are errors.

    One of the classes you need would be a Barn that contains chickens and has a time of arrival.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Mixing java and mysql
    By bad biddy in forum JDBC
    Replies: 53
    Last Post: 04-18-2012, 06:13 PM
  2. Replies: 7
    Last Post: 03-18-2011, 05:28 AM
  3. Mixing 2 audio stream threads for java mobile
    By Severus in forum Enterprise JavaBeans (EJB)
    Replies: 1
    Last Post: 08-21-2010, 06:16 PM
  4. AWT/Swing Mixing Still and issue on MAC OSX?
    By Confused in forum AWT / Swing
    Replies: 2
    Last Post: 02-21-2010, 08:34 PM
  5. Heavy and light component mixing
    By Bojevnik in forum AWT / Swing
    Replies: 2
    Last Post: 08-13-2007, 11:23 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
  •