context("Function get_rentability()")
test_that("get_rentability() works", {
# prepare inputs
n_w <- 52
opts_fast <- setSimulationPath(paste0(study_path, "/output/20171108-1548eco-fast/"))
current_it <- list()
current_it$n <- 1
current_it$full <- TRUE
candidates <- read_candidates(file = paste0(opts_fast$studyPath, "/user/expansion/candidates.ini"), opts_fast)
horizon <-opts_fast$parameters$general$horizon
x <- list()
x$invested_capacities <- antaresXpansion:::initiate_candidate_capacities(candidates, horizon)
# launch function
rentability <- antaresXpansion:::get_expected_rentability(opts_fast, current_it, candidates, n_w , x)
# compare to some known values
expect_true(all(abs(rentability - c(82231.00, -5726.00, 13059.37 ,-16497.00 ,-9910.00)) < 0.01))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.