Need help with your Discussion

Get a timely done, PLAGIARISM-FREE paper
from our highly-qualified writers!

glass
pen
clip
papers
heaphones

C++ Two-Dimensional Predator2ey Simulation Worksheet

C++ Two-Dimensional Predator2ey Simulation Worksheet

C++ Two-Dimensional Predator2ey Simulation Worksheet

Description

creating a simple two-dimensional predator2ey simulation. In this simulation the prey
are ants and the predators are doodlebugs. These critters live in a world composed of a 20 übr>20 grid of cells. Only one critter may occupy a cell at a time. The grid is enclosed, so a critter
is not allowed to move off the edges of the world. Time is simulated in time steps. Each critter
performs some action every time step.
The ants behave according to the following model:
ove. Every time step, randomly try to move up, down, left, or right. If the neighboring
cell in the selected direction is occupied or would move the ant off the grid, then the ant
stays in the current cell.
reed. If an ant survives for three time steps, then at the end of the time step (that is,
after moving) the ant will breed. This is simulated by creating a new ant in an adjacent
(up, down, left, or right) cell that is empty. If there is no empty cell available, then no
breeding occurs. Once an offspring is produced, an ant cannot produce an offspring until
three more time steps have elapsed.
The doodlebugs behave according to the following model:
ove. Every time step, if there is an adjacent ant (up, down, left, or right), then the
doodlebug will move to that cell and eat the ant. Other- wise, the doodlebug moves
according to the same rules as the ant. Note that a doodlebug cannot eat other doodlebugs.
reed. If a doodlebug survives for eight time steps, then at the end of the time step it will
spawn off a new doodlebug in the same manner as the ant.
tarve. If a doodlebug has not eaten an ant within the last three time steps, then at the
end of the third time step it will starve and die. The doodlebug should then be removed
from the grid of cells

Unformatted Attachment Preview

target_sources(code
PRIVATE Grid.cpp
PUBLIC Position.h Environment.h Organism.h Grid.h AnimalType.h
)
Purchase answer to see full
attachment
Explanation & Answer:

1 Script

User generated content is uploaded by users for the purposes of learning and should be used following our honor code & terms of service.

Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."

Order Solution Now

Our Service Charter


1. Professional & Expert Writers: Eminence Papers only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Eminence Papers are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Eminence Papers are known for the timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Eminence Papers, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.

We Can Write It for You! Enjoy 20% OFF on This Order. Use Code SAVE20

Stuck with your Assignment?

Enjoy 20% OFF Today
Use code SAVE20