Governments around the world are asking how they could stop the spread of coronavirus. Is social distancing enough? Should we go back to life as normal? How many people will die?

These are questions that are hard to answer without seeing them first-hand, but the worst case scenario is not something that we would like to see...

For my first program in C, I created a simulator that aims to do just that. A simulator that could explore the best and worst case scenarios.

Video Summary: https://www.youtube.com/watch?v=yHCsnRRvYE0


Source Code: https://github.com/EverydayCodeNet/QUARANTINE/blob/master/src/main.c
The TI-84 download can also be found here.

Currently, I am working on an options menu that will allow the user to play with the population size, social distancing measures, death rate, and more.

Upcoming Features:
- Collision detection (used to simulate social distancing)
- Options menu (Death rate, population size, immunity, recovery time)
- Points of interest (grocery stores, movie theaters, airports)
- Quarantine areas
- Obstacles (Wall blocking off sections of the population)
- Asymptomatic - have dots show healthy status, but spread it to others
- Within a few loops, both dots start to show symptoms
- OPTIMIZE! OPTIMIZE! OPTIMIZE!
- THIS THING GETS TOO SLOW!

Let me know if you have any suggestions. This program is something that I will be coming back to for the foreseeable future.

Eye Candy:


Please, wash your hands.
Please stop reminding us that we live in a simulation
This is really cool, I'm looking forward to your future updates!
Update 1:
- Used pointers to cut down on calling the array
- Implemented structure for social distancing
- Implemented structure for collisions

With pointers and better array checking implemented with help from iPhoenix++, the program has sped up a lot, but there's much to be done before it can replicate a 200 dot model.

Next Update:
- COLLISION & MORE OPTIMIZATION!

Eye Candy:

25 Dots - Optimized


25 Dots - Old


100 Dots - Optimized


This program got so fast that I had to turn down the speed of the dots. Thanks again to iPhoenix and the other forum goers who left feedback!

When the dots collide, should they go in the opposite direction, or in a random direction?
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement