My understanding of COVID 19 codified


Posted by Vishnu Vardhan Chikoti

Posted on 26-Dec-2020 16:19:38


After seeing so many news and theories around the virus since several months, this is what I understood and put together as code. Hope it will make few people understand the situation who still dont understand and help them stay safer than what they are today.

This post will be updated further as I learn more about the virus or get newer ideas on codifying it.

from knownViruses import coronaVirus

def currentSituation():
    covid19 = coronaVirus(
                            originalHost        = "Bats",
                            intermediaryHost    = "Unknown",
                            patientZero         = "Unknown",
                            firstSpillOverEvent = "Unknown",
                            virusKnowledge      = "Still don't know fully",
                            vaccineStatus       = "Started",
                            vaccineSuccess      = "ToBeProven"
                        )

    while(covid19.isActiveOnHumans())
    {

        # It's a repeated guidance to wear mask, maintain social distancing and sanitize hands
        # There is a risk of the virus spreading when the load is high enough
        # Additional condition (human.isNotVaccinatedInXMonths()) will be added once we know how long a vaccine will work

        if((human.noMask() or human.noSocialDistance()) and covid19.loadInhaled() = "High")
        {
            keepSpreading()
        }

        if(manyHumans.indoors() and covid19.loadIndoors() = "High")
        {
            keepSpreading()
        }

        if(objects.notSanitized() and objects.covidLoad() == "High")
        {
            if (human.touchedObject() and (human.didNotSantitizeHands() or human.didNotWashHands()) and human.touchedNoseEyesMouth())
            {
                keepSpreading()
            }
        }

        # COVID-19 can spill to new hosts and splill back to humans letting it mutate further

        if(covid19.spilledToNewHost())
        {
            newStrain = possibleMutation()

            if newStrain:
                spreadMutatedVirus(newStrain)

            if(newStrain.spillBackToHumans())
            {
                newStrain = possibleMutation()

                if newStrain:
                    spreadMutatedVirus(newStrain)
            }
        }
    }

def possibleMutation():

    if(covid19.canMutate())
    {
        newStrain = covid19.mutate()
        covid19Strains.append(newStrain)
    }

    # Mutation can possibly make it more infectitous. Whether it will be more deadly or not is still not clear it seems

    if(newStrain.canBeMoreInfectitous())
    {
        newStrain.morePowerful()
    }

    return newStrain

def keepSpreading():
    covid19.keepSpreading()

    # Looks like virus can mutate further within the same hosts
    newStrain = possibleMutation()

    if newStrain:
        spreadMutatedVirus(newStrain)

def spreadMutatedVirus(newStrain):
    covid19.keepSpreading(newStrain)

    # Looks like  mutated virus can mutate further
    newStrain = possibleMutation()

    if newStrain:
        spreadMutatedVirus(newStrain)

if __name__ == '__main__':
    currentSituation()

About the author

Vishnu Vardhan Chikoti is a co-author for the book "Hands-on Site Reliability Engineering". He is a technology leader with diverse experience in the areas of Application and Database design and development, Micro-services & Micro-frontends, DevOps, Site Reliability Engineering and Machine Learning.

Would you like to get notifications about New Blogs?