This code is slightly simplified implementation of fuzzy control.
In order to conquer the galaxy, a group of villains created an army of robots, artificially intelligent, spiritless creatures that attack the planets for their lord. Hence, all planets, including our own, are in danger. Fortunately, our scientists and politicians have found a way to turn this situation to our benefit. They analyze that robots can get sick, and it is quite easy to deal with sick robots. So, they developed a plague that could infect robots. In addition, they placed an undercover agent among the villains, who set up a pharmaceutical company and sold drugs to the robots. Hence, the robots implicitly contributed to our economy by buying drugs. In this way, we can both weaken the power of the villains and grow our society to protect our world.
The point of the story is to create an absolutely controllable plague among the robots. The plague infects 60% of the robots and maintains that percentage. That way, the plague will not be considered important enough to be considered by the villains to develop a permanent cure, and will always have customers to buy the medicine.
The goal is to achieve a balance of 60% of infected bots with appropriate control of the infection rate as soon as possible.
- Python 3
- numpy == 1.23.4
- matplotlib == 3.6.0
OS : Windows 10 64bit
CPU : Intel i5-10300H 2.5GHz
Internal Storage : 16384MB RAM
Runtime Environment : Python 3.10
IDE : Jupyter Notebook
Install using pip
pip install numpy
pip install matplotlib
Note: For Windows, please install python first by following the official instructions here Download Python | Python.org
Run this code under Jupyter Notebook for results