View source: R/trajectory-activities.R
| log_ | R Documentation | 
Activities for displaying messages preceded by the simulation time and the name of the arrival, and for setting conditional breakpoints.
log_(.trj, message, level = 0, ..., tag)
stop_if(.trj, condition, ..., tag)
| .trj | the trajectory object. | 
| message | the message to display, accepts either a string or a callable object (a function) which must return a string. | 
| level | debugging level. The  | 
| ... | unused. | 
| tag | activity tag name to perform named rollbacks (see
 | 
| condition | a boolean or a function returning a boolean. | 
Returns the trajectory object.
## log levels
traj <- trajectory() %>%
  log_("this is always printed") %>% # level = 0 by default
  log_("this is printed if `log_level>=1`", level = 1) %>%
  log_("this is printed if `log_level>=2`", level = 2)
simmer() %>%
  add_generator("dummy", traj, at(0)) %>%
  run() %>% invisible
simmer(log_level = 1) %>%
  add_generator("dummy", traj, at(0)) %>%
  run() %>% invisible
simmer(log_level = Inf) %>%
  add_generator("dummy", traj, at(0)) %>%
  run() %>% invisible
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.