simulator: Functions related to run a simulation

Description Usage Arguments See Also Examples

Description

Functions related to run a simulation based on a process state and a model manager. A simulator object needs to be created, then the simulator can be run. After the simulation the number of simulation steps can be returned.

Usage

1
2
3
4
	create_simulator(processState, modelManager, periodLength = 1, 
				verbose = TRUE, debug = FALSE)
	simulate(simulator)
	get_iteration_steps(simulator)

Arguments

processState

A process state object

modelManager

A model manager object

periodLength

A time span to simulate. The default is 1.

verbose

If TRUE it generates some basic information output including a progress bar

debug

If TRUE it generate a very detailed output for some models. Slows down the simulation process significantly.

simulator

A simulator object

See Also

create_process_state create_model_manager

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
	## Detailed examples of process states and model managers can be found in 
	## section 4 of the package vignette.
	processState <- create_process_state()
	modelManager <- create_model_manager()
	
	processState <- create_process_state()
	processState <- add_global_attribute(processState, 0.0, name = "timer")
	timerIndex <- get_global_attribute_index(processState, name = "timer")
	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 2, 2019, 5:20 p.m.