Skip to contents

Resource convenience function to generate a scheduling object from a timetable specification.

Usage

schedule(timetable, values, period = Inf)

Arguments

timetable

absolute points in time in which the desired value changes.

values

one value for each point in time.

period

period of repetition.

Value

Returns a schedule object.

See also

Examples

# Schedule 3 units from 8 to 16 h
#          2 units from 16 to 24 h
#          1 units from 24 to 8 h
capacity_schedule <- schedule(c(8, 16, 24), c(3, 2, 1), period=24)

env <- simmer() %>%
  add_resource("dummy", capacity_schedule)

# Composition of schedules
sch1 <- schedule(c(8, 16), c(3, 0), period=24)
sch2 <- schedule(c(16, 24), c(2, 1), period=24)
all.equal(sch1 + sch2, capacity_schedule)
#> [1] TRUE