Create a predator-prey simulation in a 2-d ecosystem

Assignment Help Computer Engineering
Reference no: EM132109295

Project Description: The goal for this programming project is to create a Predator-Prey Simulation in a two-dimensional ecosystem based on agent-based modeling. The Predator and Prey will act as agents in an ecosystem in this simulation.

The ecosystem should be modeled as an N x N grid of cells. Only one prey can occupy a cell at a time. The grid is enclosed, so a prey always stays inside the grid of cells. A prey is not allowed to move outside of the eco-system.

Time is simulated in time steps. Each prey and predator agent performs some action in every time step.

The Prey follows the following rules at each time step:

• Move: Every time step, randomly try to move up, down, left, or right. If the cell in the selected direction is occupied or would move the prey off the grid then the prey stays in the current cell.

• Breed. If a prey survives for three time steps, then at the end of the third time step (i.e., after moving), the prey will breed. This is simulated by creating a new prey in an adjacent (up, down, left, or right) cell that is empty. If there is no empty cell available, no breeding occurs. Once an offspring is produced, the prey cannot produce an offspring until three more time steps have elapsed.

A Predator behaves according to the following model:

• Move. Every time step, if there is an adjacent cell (up, down, left, or right) occupied by a prey, then the predator will move to that cell and eat the prey. Otherwise, the predator moves according to the same rules as the prey. Note that a predator cannot eat other predator objects.

• Breed. If a predator survives for eight time steps, then at the end of the time step, it will spawn off a new predator in the same manner as the prey.

• Starve. If a predator has not eaten a prey within the last three time steps, then at the end of the third time step, it will starve and die. The predator should then be removed from the grid of cells. During one turn, all the predators should move before the preys.

Before the simulation begins, the initial positions of all Preys should be randomly assigned first. Then the initial positions of the Predators should be assigned next. Note that the Simulation stops when the number of time steps ends or when one or both species population become zero.

Implement a java GUI that will allow the user to interact with the system. A suggested GUI is given below. User should be able to enter the following through the GUI:

Initial Predator count

Initial Prey count

No. of row cells in the ecosystem

No. of column cells in the ecosystem

No. of time steps.

The user clicks the "Simulate" Button and this should run the simulation. Once the simulation is over, a separate window should be shown that shows how the population of predator and prey with respect to time (x-axis: time and y-axis: No. of predator and prey).

Most likely, you should see a cyclical pattern between the population of predators and prey, although random perturbations may lead to the elimination of one or both species.

The GUI should also have a button ("Positions") which when clicked will simply print to the console the grid of cells as ASCII characters (‘x': if cell is occupied by a Predator, ‘o': if cell is occupied by a Prey, and ‘.' If cell is empty).

Reference no: EM132109295

Questions Cloud

What exactly is a configuration change management policy : What exactly is a configuration change management policy, and how should you address this for my project?
Develop for the operational manager of the indicated firm : ITECH1103- Big Data and Analytics - ANALYTIC REPORT - Write a description of the selected dataset and project, and its importance for the firm.
Build a gui that facilitates playing one round : Build a GUI (graphical user interface) that facilitates playing one round (13 hands).
Define the objects and their functions : The Launcher will fire a projectile at a target the Launcher is static, the projectile follows a linear path. The projectile has a known velocity.
Create a predator-prey simulation in a 2-d ecosystem : Create a Predator-Prey Simulation in a two-dimensional ecosystem based on agent-based modeling. The Predator and Prey will act as agents in an ecosystem in this
Design and implement a class for double link list : All member function and operator prototypes are declared in xArray.h, with necessary comments before each function.
Create a java application that grades a multiple choice quiz : Prompt the user to enter the number of questions for the quiz, then prompt the user to enter the answer key for each question. Use an array.
Create an inventory database for a manufacturing facility : This project asks to create an inventory database for a manufacturing facility in Access. You are free to create whatever type of facility you would like.
Prompts the user to enter two lists of integers : Write a program with class name StrictlyIdentical that prompts the user to enter two lists of integers of size 5 and displays .

Reviews

Write a Review

Computer Engineering Questions & Answers

  What is the loaded characteristic impedance of the bus

A backplane stripline bus measures 15" from end to end. Six equally-spaced inputs circuits are wired to the bus, each of which has a loading capacitance.

  Discuss the high frequency conmponent of the input

An Fir filter of lengt 3 is defined by a symmetric impulse response I.E., h[0] = h[2]. Let the input to this filter be a sum of two cosine sequeces of angular.

  Computes the average of the largest and smallest integer

Displays the largest integer and the smallest integer that satisfy condition number 2. Computes the average of the largest and smallest integer

  Develop a program to read a list of words as input

Develop a program to read a list of words as input. As these words are read store them into a dynamically allocated binary search tree. After all words are stored do a "pre-order" traversal of the tree.

  Determine the number of comparators needed

Show the schematic diagrams of the cache memory in Problem assuming that the data and tag areas of the cache are built out of 128-byte RAM ICs.

  Evaluate the coding artifacts in mpeg encoding

Evaluate the coding artifacts (showing up as video noise) in MPEG encoding. Provide the following details: (i) the signal characteristics of video noise (ii) the causes of the video noise, and, (iii) suggest methods to reduce the video noise.

  Make functionwill add one to each element in array of size

Write down the following C++ routines using pointers only. Do not use any [] 's in your code.

  How to make an html file to run the program

Write down a program that draws four rectangles in an applet. make an html file to run the program. Do not be concerned if part of the rectangle is "off" the screen.

  Execute a shell script to read in 3 numbers

Write down and execute a shell script to read in 3 numbers and display which is the largest and which is smallest.

  Describe how your chosen organization uses technology

Describe how your chosen organization uses technology to improve its business goals or discuss your chosen article describing IT

  What is the overall speed of the system in blocks processed

The processing step takes 20 million clock cycles, and the clock rate is 400 MHz. What is the overall speed of the system in blocks processed per second?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd