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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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