fcp2021 / UK_2020_simulation.py
UK_2020_simulation.py
Raw
from simulation import Simulation  
import sys

def warning():
    print('The below simulation takes hours to process do not run unless you have an exitable terminal')
    Input = input('Write "y" if you are happy to run this programme else click enter:')
    if Input != 'y':
        sys.exit()
def main():
    '''
    The below simulator is used to model the UK through 2020.
        Day 0 represents 31st January
        Day 60 represents start of 1st lockdown
        Day 150 represents the end of this lockdown
        Day 230 represents the start of the 'November lockdown
        Day 258 represents the end of this lockdown
    Results will be saved to csv files in the same folder
    
    Returns
    -------
    None.

    '''
    UK2020 = Simulation(8000, 2, 2, 1.2, 10, 1.2, 2, 300, 0.3, 1, 0.3, 1)
    days = 0
    UK2020.state = UK2020.init_array()
    UK2020.stats_init()
    while days < UK2020.days:
        UK2020.day_run()
        if UK2020.day == 60:
            UK2020.lockdown = True
        if UK2020.day == 150:
            UK2020.average_interactions_symp_current = 1
            UK2020.max_range_symp_current = 2
            UK2020.average_interactions_asymp_current = 0.5
            UK2020.max_range_asymp_current = 5
        if UK2020.day == 230: #this wil rise too fast
            UK2020.lockdown = True
        if UK2020.day == 258:
            UK2020.lockdown = False
        days += 1
if __name__ == '__main__':
    warning()
    main()