location, state_location, country_location, n, with_non_teaching_staff=True, with_school_types=False, school_mixing_type=school_mixing_type, average_class_size=average_class_size, inter_grade_mixing=inter_grade_mixing, average_student_teacher_ratio=average_student_teacher_ratio, average_teacher_teacher_degree=average_teacher_teacher_degree, average_student_all_staff_ratio=average_student_all_staff_ratio, average_additional_staff_degree=average_additional_staff_degree, ) sp.show_layers(population) # sp.generate_synthetic_population(n, datadir, location='seattle_metro', state_location='Washington', country_location='usa', sheet_name='United States of America', # with_school_types=False, school_mixing_type='random', average_class_size=20, inter_grade_mixing=0.1, # average_student_teacher_ratio=20, average_teacher_teacher_degree=3, teacher_age_min=25, teacher_age_max=75, # average_student_all_staff_ratio=15, average_additional_staff_degree=20, staff_age_min=20, staff_age_max=75, # verbose=False, plot=False, write=False, return_popdict=False, use_default=False) # population = sp.make_population(n, # generate=True, # with_school_types=True, # school_mixing_type=school_mixing_type) for i in range(3000): person = population[i] if person['sc_staff']:
verbose = False plot = True write = True # this will generate a population with microstructure and age demographics that approximate those of the location selected # also saves to file in: # datadir/demographics/contact_matrices_152_countries/state_location/ sp.generate_synthetic_population(n, datadir, location=location, state_location=state_location, country_location=country_location, sheet_name=sheet_name, verbose=verbose, plot=plot, write=write) # load that population into a dictionary of individuals who know who their contacts are options_args = {'use_microstructure': True} network_distr_args = {'Npop': n} contacts = sp.make_contacts(location=location, state_location=state_location, country_location=country_location, options_args=options_args, network_distr_args=network_distr_args) verbose = True # verbose = False if verbose: sp.show_layers(contacts, show_ages=True, show_n=2)