C++

COMPLETE BONUS 2

For this project you will be designing and implementing a system, in either C or C++, to simulate an outbreak across a geographic area. Specifically, you will be using a cellular automata, with a Moore neighborhood configuration, to model a geographic region, and an SIR model to model the health states of the populace. Your model should visually output how the region’s population changes over time, the final S, I, R counts, the day of the outbreak’s peak, and the day the outbreak ended.

Additionally, sample input files will not be uploaded to Canvas, but can instead be found on the CSE machines at ~jeh0289/public/csce2100/su18/proj2/ You can cd into that directory and copy input the files from there.

For the project you may, if you choose, work in small groups of up to three students. I will need the names of all of the group members emailed to me by no later than midnight (6/4). Any student who is not in one of the groups I receive emails for will be assumed to be working on their own. A list of groups and their members will be posted on Canvas, after it is compiled. A group cannot be changed once created, unless it is completely dissolved. All members of a group will receive the same grade, and all members are expected to contribute equally to the programming and report. Only one submission per group will be required, but a group will not be penalized for having multiple members submit the completed project.

Also, as a reminder, all of the code for this assignment must be written by your group. You may not share code or download solutions off the internet, as doing so will be considered cheating.

Requirements

This assignment has two parts: a design portion and an implementation portion.

Design Document

For the design portion, you must generate documentation, in PDF format, describing your system and design process. The purpose of this is for you to explain not just what your system is doing, and how it is doing it, but why. You will need to justify your design decisions in a concise, informative manner. Justifications such as “I did this because it was easy” are not sufficient, as you should actually explain why a particular data structure or algorithm was more efficient, effective, or optimal. Additionally, commented code, while sometimes helpful in small examples, is not a sufficient explanation in and of itself. Your explanations and justifications are expected to be presented in prose and in paragraph format, i.e. not bulleted lists. Further, part of the evaluation of your design document is the apparent amount of thought and effort that went into its creation.

This document should be divided into four main parts, each with an appropriate header.

In the first part, you should describe your design process. Did you work out the algorithm on paper or a whiteboard before hand? Did you draw UML diagrams of the system? Did you create a small prototype? Did you simply start coding away and then recode once or twice with newfound understanding? In a few paragraphs, describe in detail how you went about designing the system, and be sure to provide sufficient justification of your methodology.

For the second part, you should describe the data structures you used in your system. What, if any, objects or structs did you create to store data? How did you organize and manage them? What types of formal data structures did you make use of (trees, graphs, arrays, hashes, etc)? In a few paragraphs, describe in detail how you stored the various data elements in your system, and be sure to provide sufficient justification of your methodology.

For the third part, you should describe functionality of your system. How is data moved and transformed? How is it read in? How is it output? What are the various major functions you constructed and how do they work? In a few paragraphs, describe in detail how your system works, and be sure to provide sufficient justification of your methodology. You might also consider including diagrams to more easily visualize how all of the pieces fit together.

Finally, you will need to briefly describe what share of the work was performed by each group member. Be sure to be specific about tasks.

Implementation

Your program must provide the following functionality and adhere to the following constraints:

  • Allow the user to choose the file describing the initial setup of the simulation

o The first line indicates how many surrounding cells in a cell’s neighborhood must be infectious for a susceptible cell to become infectious on the next day o The second line indicates how many days a cell remains infectious for before it becomes recovered on the following day

o The third line indicates how frequently the region should be displayed in days

o All subsequent lines will indicate the starting health states of the different cells in the region

  • s: susceptible
  • i: infectious
  • r: recovered
  • v: vaccinated
  • A cell can have one of four health states: susceptible, infectious, recovered, vaccinated

o Vaccinated and recovered cells can never become infectious

  • The simulation should run until the number of infectious cells is 0, indicating the outbreak has ended
  • The initial setup of the region represents the simulation at day 0
  • Your program should output the following:

o The initial status of the region

o The status of the region every X days, where X is the frequency from the input file

o The final state of the region once the outbreak has ended

o The final counts of the number of susceptible, infectious, and recovered individuals once the outbreak has ended o The day the outbreak ended

o The first day of the outbreak’s peak in terms of number of infectious individuals

  • Your code must be well commented.
  • You must provide a short README file which includes your name and explains how to compile and run your program.
  • Additionally, you may write a makefile if you want your code to compile with additional flags.

Submission A .zip file containing the following:

  1. All files necessary to compile and run your program 2. A README file explaining how to compile and run your program

Bonus For 10 bonus points, your system must be able to be configured with a reachability attribute and a probability of infection attribute. Reachability describes how many squares away from a cell its neighborhood extends to, e.g. a reachability of 1 would include the 8 cells surrounding a cell in its neighborhood, while a reachability of 2 would include the 24 cells surrounding a cell in its neighborhood. The probability of infection describes the probability of a single cell becoming infected by the cells in its neighborhood, and replaces the number of surrounding cells required attribute. This probability is multiplied by the number of infectious cells in a cell’s neighborhood.

Order from us and get better grades. We are the service you have been looking for.