R Under development (unstable) (2023-08-05 r84874 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(efdm) > library(testthat) > > statespace <- expand.grid(a=1:2, b=1:2, vol=1:5) > state0 <- statespace > actprob <- statespace > actprob$test <- 1 > state0$area <- 0 > state0$area[1] <- 1 > > > act1 <- define_activity("test", character()) > expect_error(transprobs(act1) <- data.frame(vol0 = 1:4, vol1=2:5, prob=1)) > state1 <- runEFDM(state0, actprob, list(act1), 5) > expect_equal(state1$vol, rep(1, 6)) > > act2 <- define_activity("test2", "vol") > transprobs(act2) <- data.frame(vol0=1:5, vol1=c(2:5,5), prob=1) > actprob$test <- 0.1 > actprob$test2 <- 0.9 > expect_known_hash(runEFDM(state0, actprob, list(act1, act2), 5), "1b23f7f782") > > > proc.time() user system elapsed 0.96 0.07 1.04