Skip to content

Commit 0bfe519

Browse files
committed
feat(logs): add mcq (#145)
1 parent 229f38e commit 0bfe519

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

pages/guide/model/logs.qmd

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1687,6 +1687,54 @@ print(log_contents, sep = "\n")
16871687

16881688
## Test yourself
16891689

1690+
<div class="h3-tight"></div>
1691+
1692+
### Quiz
1693+
1694+
```{r}
1695+
#| echo: false
1696+
library(webexercises) # nolint: library_call_linter
1697+
```
1698+
1699+
::: {.callout-note}
1700+
1701+
## Why are logs useful when building and verifying a DES model?
1702+
1703+
```{r}
1704+
#| output: asis
1705+
#| echo: false
1706+
cat(longmcq(c(
1707+
answer = paste0(
1708+
"They let you see when key events occur (e.g. arrivals, consultations), ",
1709+
"helping you spot bugs and check that the model behaves as intended."
1710+
),
1711+
"They replace the need for any formal validation or testing."
1712+
)))
1713+
```
1714+
1715+
:::
1716+
1717+
::: {.callout-note}
1718+
1719+
## Why is logging designed to be optional, rather than always on?
1720+
1721+
```{r}
1722+
#| output: asis
1723+
#| echo: false
1724+
cat(longmcq(c(
1725+
"Because logs are only useful during sensitivity analysis.",
1726+
"Because DES models cannot run correctly if any logging is enabled.",
1727+
answer = paste0(
1728+
"Because detailed logs are helpful for short test runs and debugging but ",
1729+
"would be excessive and slow for long runs or many replications."
1730+
)
1731+
)))
1732+
```
1733+
1734+
:::
1735+
1736+
### Activity
1737+
16901738
Try **adding logs to your model**. Experiment with different log messages and parameter options, then run your code and observe how the logs reflect your changes at each step.
16911739

16921740
If you extend your model (for example, with different patient types, destinations, or additional resources), continue making use of logs. Logging is especially valuable during **model development** - it helps you check that each part of your logic works as intended and makes it easier to troubleshoot issues as your simulation grows in complexity.

0 commit comments

Comments
 (0)