Skip to content
Snippets Groups Projects
Select Git revision
  • af784cc29a0e5795adeb68d3195597ebcd67c076
  • main default
  • tp3
  • tp2
  • tp1
  • tp3-correction
  • tp2-correction
  • tp1-correction
  • admins
9 results

calculator.py

Blame
  • Forked from an inaccessible project.
    model.m 1.00 KiB
    classdef model < handle
        properties
            vector
            Slist
            Ilist
            Rlist
            Wlist
        end
        
        methods
            function obj=model(S, I, R, Waiting, N)
                if nargin > 4
                    repeat = N;
                else
                    repeat = 100;
                end
                    
                obj.vector(1) = S;
                obj.vector(2) = I;
                obj.vector(3) = R;
                for i = 1:Waiting
                    obj.vector(3+i) = 0;
                end
                obj.Slist = zeros(1, repeat);
                obj.Ilist = zeros(1, repeat);
                obj.Rlist = zeros(1, repeat);
                obj.Wlist = zeros(1, repeat);
            end
            
            function step(obj, i, coeffs, VaccinationVec)
                obj.Slist(i) = obj.vector(1);
                obj.Ilist(i) = obj.vector(2);
                obj.Rlist(i) = obj.vector(3);
                obj.Wlist(i) = sum(obj.vector(4:length(obj.vector)));
                obj.vector = step(obj.vector, coeffs, VaccinationVec(i));
            end
        end
    end