Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 8 of 8

Thread: Concurrency Programming GURUS: Help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  1. #1
    Junior Member
    Join Date
    Sep 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Concurrency Programming GURUS: Help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    There exists a mountainous land in a galaxy far, far away (called MKWorld) where a number (n) of strange magical animals roam. All these animals have a location device attached to them, which periodically outputs their coordinates (x,y) and height above sea LEVEL (note that some animals may live in the deep sea). You are a biologist studying these animals. However, unfortunately you can never see these animals ( “far, far away”). The only information you have for your scientific inquiry is the text files produced by the location devices. Each file contains a (potentially very long) record (or time series) of the roaming of a particular animal. This is a list of numbers with the format:

    <counter> <x> <y> <height>





    Here, <counter> keeps track of the number of readings recorded

    – it will be sequential, but may count in increments greater than 1. The coordinate values <x> and <y> can be thought of as the latitude and the longitude, but may have odd ranges - this is not Earth!





    Also, note that counter must be a long value and <x> , <y> and

    <h> are floating point values.





    The magical strength (M) of each animal is determined by the temperature (which is constant throughout the land), their current x,y position and height h, according to the following expression:

    M[x][y] = -T*ln(P(x,y)) – h

    Here, P is the probability of animals being at a particular point. Probability is calculated in a straightforward manner as the number of times that an animal is at a particular x,y value divided by the total number of records. To make things easier, you will divide the2D space into blocks and calculate a 2D histogram of the x,y frequency for each animal in each block and then calculate the probabilities of each block from that. The accuracy of this approach is determined by the block size, which is determined by the number of divisions, or bins, in each dimension. You decide that this will best be done with an input parameter, to allow you to fiddle with different grid resolutions. You also don’t know the range of values for either <x> or <y>, but will need to obtain them from scanning the file.


    Finally, for the formula you will also need to calculate the average height for each grid point.

    The application should output the magical strength matrix for each animal individually, as well as a magical strength matrix for all the animals together. It should be as concurrent as possible – you want research results quickly!


  2. #2
    Super Moderator Sean4u's Avatar
    Join Date
    Jul 2011
    Location
    Tavistock, UK
    Posts
    637
    Thanks
    5
    Thanked 103 Times in 93 Posts

    Default Re: Concurrency Programming GURUS: Help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    you want research results quickly!
    I don't feel the slightest trace of desire for such a thing in this case.

    You might be better off addressing a request like this one to liveperson.com, or alternatively you could post your best shot at a solution and some of us might constructively criticise it, offer opinion / help / encouragement etc. My top tip would be to say exactly what it is you would like a respondent to do. If it's "do my work for me", I suspect you'll get a few unpleasant responses.

  3. #3
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Concurrency Programming GURUS: Help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    These forums do not work this way, and sending out multiple private messages will hurt your chances of receiving help even more. Once you make an effort, should you get stuck, ask a specific question. We are not a homework service or a code repository. Some recommended reading:

    How To Ask Questions The Smart Way

    http://www.javaprogrammingforums.com...e-posting.html

  4. #4
    Junior Member
    Join Date
    Sep 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Concurrency Programming GURUS: Help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    Not a smart question i see..Just needed some help with the conceptualization of this problem.

  5. #5
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: You still remember how its like to be a Java Newbie:Please help..

    Is that your assignment that you have posted?
    Do you have any specific questions or problems with it?
    Please post them here.

  6. #6
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Concurrency Programming GURUS: Help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    I have deleted your duplicate threads, and moved Norm's questions to this one. I suggest that you answer them.

    I also suggest you read copeg's links on asking questions the smart way and programming a homework assignment before you post again.

    Further spamming of unanswerable homework questions will get you banned.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  7. #7
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Pakistan
    Posts
    1,136
    My Mood
    Grumpy
    Thanks
    20
    Thanked 82 Times in 78 Posts
    Blog Entries
    1

    Default Re: Concurrency Programming GURUS: Help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    Well Novice85, the description you added is so long that it annoyed me, so i can guess that many others can get annoyed too.
    It took me to concentrate five to six times on the description as it was not that explainatory.
    Well, i don't want to be a hater, just try to read the forum rules.
    And try to post the problem you got?
    If you want the conceptualization, then atleast be precise and write a short description to let us help you.
    Thanks

  8. #8
    Member
    Join Date
    Jun 2011
    Posts
    56
    Thanks
    2
    Thanked 7 Times in 6 Posts

    Default Re: Concurrency Programming GURUS: Help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    To get results quickly,each animal's time series can be processed separately because the magical strength of
    animals is independent of one other. This parallelization is limited by the number of animals you have so
    further divide the work for each animal into smaller pieces. You have already gathered all the data and it is not a live feed.Then divide your region into a grid, and count the number of records in each region in parallel. Writes are not thread safe so you need to synchronize there. Use a 2D array to store the counts in each cell. Then you plot the histograms and calculate strength from the frequency tables. The rest is detail you can work out. I don't see any use for the counter since it can be incremented by any amount. So keep track of your own I guess. Hope that helps.

Similar Threads

  1. java concurrency problem
    By Nick7 in forum What's Wrong With My Code?
    Replies: 5
    Last Post: August 1st, 2011, 06:02 AM
  2. NEW COMER SEEKING KNOWLEDGE AND GURUS
    By Abu Muhammad in forum Member Introductions
    Replies: 1
    Last Post: March 17th, 2011, 04:34 AM
  3. hello all you java gurus and newbies
    By johneusmc in forum Member Introductions
    Replies: 2
    Last Post: October 6th, 2010, 02:57 AM
  4. New to programming
    By Milanocookies56@gmail.com in forum What's Wrong With My Code?
    Replies: 5
    Last Post: March 31st, 2010, 09:55 AM
  5. hello you Java gurus out there
    By fraxx in forum Member Introductions
    Replies: 2
    Last Post: October 22nd, 2009, 03:33 PM