Beispiel #1
0
 def __init__(self, nu, beta, S0, I0, R0, T, V0, p):
     ProblemSIR.__init__(self, nu, beta, S0, I0, R0, T)
     self.V0 = V0
     if isinstance(p, (float, int)):
         self.p = lambda t: p
     elif callable(p):
         self.p = p
Beispiel #2
0
    def __init__(self, nu, beta, p, S0, I0, RO, V0,
                 T):  ## -> Skriver som attributter
        PSIR.__init__(self, nu, beta, S0, I0, RO, T)
        self.V0 = V0

        if isinstance(p, (float, int)):  # p tall
            self.p = lambda t: p
        elif callable(p):  # p funksjon
            self.p = p
Beispiel #3
0
    def __init__(self, nu, beta,  S0, I0, R0, T, V0, p):
        ProblemSIR.__init__(self,nu, beta, S0, I0, R0, T)   #calling __init__ from Superclass
        self.V0= V0     #initialization of vaccination (belongs to ProblemSIRV)

        # wrap fraction as a function of time or constant
        if isinstance(p,(float,int)):
            self.p= lambda t: p
        elif callable(p):
            self.p= p
Beispiel #4
0
    def __init__(self, v, beta, S0, I0, R0, V0, p, T):

        ProblemSIR.__init__(self, v, beta, S0, I0, R0,
                            T)  # let ProblemSIR store parameters
        self.V0 = V0  # initial no. people vaccinated

        if isinstance(p, (float, int)):  # is p a number?
            self.p = lambda t: p  # wrap p in a function
        elif callable(p):
            self.p = p
Beispiel #5
0
    def __init__(self, v, beta, S0, I0, R0, V0, p, T):

        ProblemSIR.__init__(self, v, beta, S0, I0, R0,
                            T)  # let ProblemSIR store parameters
        self.V0 = V0  # initial no. people vaccinated
        self.p = p  # fraction of susceptibles vaccinated per dt
Beispiel #6
0
 def __init__(self, nu, beta, S0, I0, R0, T, V0, p):
     ProblemSIR.__init__(self, nu, beta, S0, I0, R0, T)
     self.V0, self.p = V0, p