Extract or set end generation

end_gen(x)

end_gen(x) <- value

Arguments

x

A slimr_script object

value

A end generation value to replace with.

Examples

script <- slim_script(
  slim_block_init_minimal(),
  slim_block(1, 100, {
    sim.outputFull()
  })
)
script
#> <slimr_script[2]>
#> block_init:initialize() {
#>     initializeMutationRate(1e-07);
#>     initializeMutationType("m1", 0.5, "f", 0);
#>     initializeGenomicElementType("g1", m1, 1);
#>     initializeGenomicElement(g1, 0, 1e+05 - 1);
#>     initializeRecombinationRate(1e-08);
#> }
#> 
#> block_2:1:100 early() {
#>     sim.outputFull();
#> }
end_gen(script)
#> [1] NA    "100"
end_gen(script)[2] <- 1000
script
#> <slimr_script[2]>
#> block_init:initialize() {
#>     initializeMutationRate(1e-07);
#>     initializeMutationType("m1", 0.5, "f", 0);
#>     initializeGenomicElementType("g1", m1, 1);
#>     initializeGenomicElement(g1, 0, 1e+05 - 1);
#>     initializeRecombinationRate(1e-08);
#> }
#> 
#> block_2:1:1000 early() {
#>     sim.outputFull();
#> }