This method initialises a trajectory object, which comprises a chain of activities that can be attached to a generator. See below for a complete list of available activities by category.
See also
Available activities by category:
Delays:
timeout
,timeout_from_attribute
,timeout_from_global
Arrival properties:
set_attribute
,set_global
,set_prioritization
Interaction with resources:
select
,seize
,release
,release_all
,seize_selected
,release_selected
,release_selected_all
,set_capacity
,set_queue_size
,set_capacity_selected
,set_queue_size_selected
Interaction with generators:
activate
,deactivate
,set_trajectory
,set_source
Branching:
branch
,clone
,synchronize
Loops:
rollback
Reneging:
leave
,handle_unfinished
,renege_in
,renege_if
,renege_abort
Manage trajectories:
Extract or Replace Parts of a Trajectory:
Extract.trajectory
Join Trajectories:
join
Number of Activities in a Trajectory:
length.trajectory
,get_n_activities
Examples
## create an empty trajectory
x <- trajectory("my trajectory")
x
#> trajectory: my trajectory, 0 activities
## add some activities by chaining them
x <- x %>%
log_("here I am!") %>%
timeout(5) %>%
log_("leaving!")
x
#> trajectory: my trajectory, 3 activities
#> { Activity: Log | message: here I am!, level: 0 }
#> { Activity: Timeout | delay: 5 }
#> { Activity: Log | message: leaving!, level: 0 }
## join trajectories
x <- join(x, x)
## extract and replace
x[c(3, 4)] <- x[2]
x
#> trajectory: my trajectory, 6 activities
#> { Activity: Log | message: here I am!, level: 0 }
#> { Activity: Timeout | delay: 5 }
#> { Activity: Timeout | delay: 5 }
#> { Activity: Timeout | delay: 5 }
#> { Activity: Timeout | delay: 5 }
#> { Activity: Log | message: leaving!, level: 0 }