View source: R/trajectory-activities.R
| set_trajectory | R Documentation | 
Activities for modifying a source's trajectory or source object by name.
Sources must be defined in the simulation environment (see
add_generator, add_dataframe).
set_trajectory(.trj, sources, trajectory, ..., tag)
set_source(.trj, sources, object, ..., tag)
.trj | 
 the trajectory object.  | 
sources | 
 the name(s) of the source(s) or a function returning the name(s).  | 
trajectory | 
 the trajectory that the generated arrivals will follow.  | 
... | 
 unused.  | 
tag | 
 activity tag name to perform named rollbacks (see
  | 
object | 
 a function modelling the interarrival times (if the source type is a generator; returning a negative value or a missing value stops the generator) or a data frame (if the source type is a data source).  | 
Returns the trajectory object.
activate, deactivate
traj1 <- trajectory() %>%
  timeout(1)
traj2 <- trajectory() %>%
  set_source("dummy", function() 1) %>%
  set_trajectory("dummy", traj1) %>%
  timeout(2)
simmer() %>%
  add_generator("dummy", traj2, function() 2) %>%
  run(6) %>%
  get_mon_arrivals()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.