deleteBreakpoint: Delete a Scenario breakpoint

Description Usage Arguments Value See Also Examples

Description

This function will delete a Scenario breakpoint.

Usage

1
2
3
4
deleteBreakpoint(x, transformerName = NULL, breakpointType = NULL)

## S4 method for signature 'Scenario'
deleteBreakpoint(x, transformerName = NULL, breakpointType = NULL)

Arguments

x

Scenario object

transformerName

character. A Stochastic Time Transformer e.g. "stsim_Runtime" (optional)

breakpointType

character. Options include "bi" (before iteration), "ai" (after iteration), "bt" (before timestep), or "at" (after timestep) (optional)

Value

A SyncroSim Scenario with an updated list of breakpoints.

See Also

addBreakpoint.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
## Not run: 
# Create callback function
callbackFunction <- function(x, iteration, timestep) {
  print(paste0("Breakpoint hit: ", scenarioId(x)))
}

# Install helloworldSpatial package
addPackage("helloworldSpatial")

# Set SsimLibrary name
myLibraryName <- file.path(tempdir(),"testlib")

# Set Session and SsimLibrary
mySession <- session()
myLibrary <- ssimLibrary(name = myLibraryName,
                         session = mySession,
                         package = "helloworldSpatial")
myScenario <- scenario(myLibrary, "My Scenario")

# Add breakpoints before the 1st and 2nd iterations
myScenario <- addBreakpoint(x= myScenario,
                            transformerName= "helloworldSpatial_Primary",
                            breakpointType = "bi", 
                            arguments = c(1,2),
                            callback = callbackFunction)
                            
# Check that the breakpoints were added
breakpoint(myScenario)

# Delete breakpoints
myScenario <- deleteBreakpoint(myScenario)

# Check that breakpoints were deleted
breakpoint(myScenario)

## End(Not run)

rsyncrosim documentation built on Oct. 28, 2021, 1:07 a.m.