Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

The dynamics between predators and preys in a given ecosystem attracts a lot of attention from researchers. Different scientists have developed Predator-Prey models to try to understand the interactions and foresee the evolution of the populations.

One of the first analyzed Predator-Prey ecosystems was the "Lynx - Snowshoe hare" and one of the first Predator-Prey models defined was the one developed by Lotka and Volterra.

This Predator-Prey model defines:

* H[n] as the snowshoe hare population (being n a specific moment of time)

* L[n] as the lynx population

* It assumes that the primary growth of the hare population in the absence of lynx is a1*H[n] and that the lynx population in the absence of hares declines -b1*L[n]

* It also assumes that the primary loss of snowshoe hares is due to predating -a2*H[n]*L[n] and the growth of the lynx population is from the energy derived from eating snowshoe hares b2*H[n]*L[n]

The Lotka-Volterra model is defined by the following formula:

H[n+1] = H[n] + a1 * H[n] - a2*H[n]*L[n] = H[n] * (1 + a1 - a2*L[n])

L[n+1] = L[n] - b1 * L[n] + b2*H[n]*L[n] = L[n] * (1 - b1 +b2*H[n])

For instance, let's assume that the initial population of snowshoe hares is 300 and the initial population of lynxes is 20, and the values of the constants that regulate the model are a1 = 0.1, a2 = 0.01, b1 = 0.01 and b2 = 0.00002. The previous formula can be used to calculate the population of both lynxes and snowshoe hares after 2 periods:

After 1 period the population of snowshoe hares will be:

H[1] = H[0] + a1 * H[0] - a2*H[0]*L[0] = H[0] * (1 + a1 - a2*L[0]) = 300 *(1 + 0.1 - 0.01*20) = 270

In turn, the population of lynxes will be:

L[1] = L[0] - b1 * L[0] + b2*H[0]*L[0] = L[0] * (1 - b1 +b2*H[0]) = 20 * (1 - 0.01 + 0.00002*300) = 19.92

Notice that we keep the decimals for the following loop in the formula.

After 2 periods, the population of snowshoe hares will be:

H[2] = H[1] * (1 + a1 - a2*L[1]) = 270 * (1 + 0.1 - 0.01*19,92) = 243.216

And the population of lynxes will be:

L[2] = L[1] * (1 - b1 +b2*H[1]) = 19.92 * (1 - 0.01 + 0.00002*270) = 19.828368

If we continue, we can guess the population after 20 periods:

H[20] = 47.15 snowshoe hares

L[20] = 17.28 lynxes

or after 100 periods:

H[100] =8.44 snowshoe hares

L[100] =7.89 lynxes

or even after 200 periods:

H[200] = 903.17 snowshoe hares

L[200] = 3.91 lynxes
-----------------------------------------------------------------------------------------------
The goal of this activity is to: SOLVE THIS PROBLEM PROGRAMMING AN ITERATIVE METHOD
-----------------------------------------------------------------------------------------------

Guidelines for solving the problem:

1) The header of the method should be:

? double[] preyPredLV(double[] preyPred, double[] a, double[] b, int n)

2) The method should have as arguments:

? An array called "preyPred" with 2 doubles:
? The initial population of snowshoe hares, preyPred[0];
? The initial population of lynx, preyPred[1]

? An array called "a" with 2 doubles containing the constants a1 and a2:
? a[0] = a1;
? a[1] = a2;

? An array called "b" with 2 doubles containing the constants b1 and b2:
? b[0] = b1;
? b[1] = b2;

? The number of periods, "n", at which we want to predict the future population of snowshoe hares and lynxes.

3) The method should return the array "preyPred", in a way that it should contain:

? The population of snowshoe hares at the given number of periods "n" (H[n]) in preyPred[0];

? The population of lynxes at the given number of periods "n" (L[n]) in preyPred[1].

4) You can choose to solve this problem using one of the following two possibilities:

? To implement an iterative method with a for loop; or

? To implement an iterative method with a while loop

Java, Programming

  • Category:- Java
  • Reference No.:- M91296696
  • Price:- $110

Guranteed 48 Hours Delivery, In Price:- $110

Have any Question?


Related Questions in Java

Object-oriented software development1 introduction 11

OBJECT-ORIENTED SOFTWARE DEVELOPMENT 1. Introduction 1.1 Assignment Requirement 1.2 Deliverables and Structure (what to submit) 1.3 Software Restrictions 1.4 How to score high... 1.5 Assumptions 2. System Requirements 2. ...

Retail price calculatorwrite a java program that asks the

Retail Price Calculator Write a JAVA program that asks the user to enter an item's wholesale cost and its markup percentage. It should then display the item's retail price. For example: (If an item's wholesale cost is 5. ...

In relation to javaa what is constructor the purpose of

(In relation to Java) A. What is constructor? the purpose of default constructor? B. How do you get a copy of the object but not the reference of the object? C. What are static variables and instance variables? D. Compar ...

Answer the following question whats the difference public

Answer the following Question : What's the difference public inheritance and private inheritance? What can derived classes inherit from base classes? What cannot be inherited from base classes?

Can someone help me please with those question1what is the

Can someone help me please with those question 1:what is the best data type for student id datatime,currency,number,decimal 2:which relationshipis preferable? one to one,one to many,many to many 3:if you add table A's pr ...

Applied software engineering assignment 1 -learning

Applied Software Engineering Assignment 1 - Learning outcomes - 1. Understand the notion of software engineering and why it is important. 2. Analyse the risk factors associated with phases of the software development lif ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Operating systems assignment -problem 1 sharing the bridgea

Operating Systems Assignment - Problem 1: Sharing the Bridge A new single lane bridge is constructed to connect the North Island of New Zealand to the South Island of New Zealand. Farmers from each island use the bridge ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Assessment instructionsin this assessment you will design

Assessment Instructions In this assessment, you will design and code a simple Java application that defines a class, instantiate the class into a number of objects, and prints out the attributes of these objects in a spe ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As