Trauma-Team-International / Home

Trauma Team International || Autonomio's Coronavirus Task Force
MIT License
4 stars 1 forks source link

event-based simulator improvements #33

Open mikkokotila opened 4 years ago

mikkokotila commented 4 years ago

Blocking use

if you have:

place_available = (hospital.departments_capacity[icu_type]['max_capacity'] - len(
    hospital.departments_capacity[icu_type]['icu_date_arriving_list']))

you must make it instead:

_max_capacity_ = hospital.departments_capacity[icu_type]['max_capacity']
_new_cases_ = len(hospital.departments_capacity[icu_type]['icu_date_arriving_list'])

place_available = _max_capacity_ - _new_cases_

Note that temp variables can start with and end with to make it clear they are merely temp variables to keep code clean. Also they must use names that make it completely clear what those variables are. Each line of the code should be completely clear to read.

Improvements

DO NOT spend time with these before we have rolled-out a usable version as per above.