Risk Analysis Simulator Using Python
Risk Analysis Simulator Using Python
Methodology
- This simulation uses population as a time constraint. First, we analyze previous data regarding that area’s population for the last few years or decades, then we calculate the population for the test period.
- We have to give the probability of survival concerning threats or viruses by analyzing previous data. Then our simulator will provide us with a number of people who has still a great chance of survival with their probability of survival.
- All characteristics are distributed randomly to the initial test subject. Then we let them reproduce randomly (without based on gender) until it resembles the user’s input to the population.
Example :
Let’s assume their apocalypse is going on. Only four people survived
with all different characteristics (let’s take them all have four characteristics.)
Let’s assume there are only eight characteristics as follows :
Intelligence, Strength, Courage, Kindness, Stupidity, Weak, Coward, Meanness.
All eight have a specific probability of survival as follows:
All characteristics are distributed randomly for those 4 test subjects (x1, x2, x3, x4);
As shown in the code below:
Then we let them reproduce randomly (without based on gender) until it resembles the user’s input to the population.
Here we have given the input population as ‘1000’.
We multiply Frequency by the probability of that characteristic.
And at the end, by taking the mean, we can get the number of people with a high chance of survival rate and their corresponding probability of survival.
Our current simulation concerning the given data says that there is a Chance of 271 people surviving in the apocalypse, with the highest survival probability of 0.4286.
Like this, we can use this simulation for many uses, like simulating specific human genetic structure changes.
We can also use it to make NPC(non-playing characters) in games to make them more like us; As we see that many games have NPC, which doesn’t change their age or profession, or they don’t even reproduce. They stay the same all the time.
What if we can give them abilities, characteristics, lifespan, the ability to reproduce, and death? We can create jobs with some required skills or characteristics, and based on that, NPC can change Jobs or explore more Jobs. To them become more alive than ever.
Click Here For The Simulation’s Algorithm.
Thank you for reading!
If you enjoyed reading it, you could even clap 👏🏽 below.
If you have any feedback or want to chat with me, drop me a message at gthakkarwad@me.iitr.ac.in or connect with me on LinkedIn.
Comments
Post a Comment