implementing rules for epidemy simulation