time_updater: Overview of time updaters implemented in NetSim

Description Usage Arguments See Also Examples

Description

Overview of time updaters implemented in NetSim. So far, there is one time updater that keeps a global timer up-to-date by adding time spans determined by time models.

Usage

1
	create_timer_updater(timerIndex)

Arguments

timerIndex

A pointer to a global attribute in the process state representing the timer

See Also

create_model_manager

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
	processState <- create_process_state()
	
	# add timer variable to process state
	processState <- add_global_attribute(processState, name = "timer", value = 0)
	timerIndex <- get_global_attribute_index(processState, name = "timer")
	
	# create time updater based on the timer index
	timeUpdater <- create_timer_updater(timerIndex)
	
	modelManager <- create_model_manager()
	
	myTimeModel <- create_round_based_time_model(timerIndex)
	modelManager <- add_time_model(modelManager, myTimeModel)
	
	timeSpan <- 20
	simulator <- create_simulator(processState, modelManager, timeSpan,
	verbose = TRUE, debug = FALSE)
	simulate(simulator)

NetSim documentation built on May 29, 2017, 6:41 p.m.