Skip to content

Commit

Permalink
fix immunized
Browse files Browse the repository at this point in the history
  • Loading branch information
GianmarcoRasi committed May 28, 2024
1 parent a6d6980 commit dd98689
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions chapters/chap12.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,12 @@
"outputs": [],
"source": [
"def add_immunization(system, fraction):\n",
" system.init.s -= fraction\n",
" system.init.r += fraction"
" # Multiply 'fraction' by the proportion of susceptible\n",
" # individual to be sure to subtract and add a value that \n",
" # does not exceeds the proportion of susceptible \n",
" # individials\n",
" system.init.s -= fraction*system.init.s\n",
" system.init.r += fraction*system.init.s"
]
},
{
Expand Down
8 changes: 6 additions & 2 deletions notebooks/chap12.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,12 @@
" system: System object\n",
" fraction: number from 0 to 1\n",
" \"\"\"\n",
" system.init.S -= fraction\n",
" system.init.R += fraction"
" # Multiply 'fraction' by the proportion of susceptible\n",
" # individual to be sure to subtract and add a value that \n",
" # does not exceeds the proportion of susceptible \n",
" # individials\n",
" system.init.S -= fraction*system.init.S\n",
" system.init.R += fraction*system.init.S"
]
},
{
Expand Down

0 comments on commit dd98689

Please sign in to comment.