Return one solution per instance for different values of blm. Like prioriactions() function, it inherits all arguments from inputData(), problem() and solve().

evalBlm(values = c(), ...)

Arguments

values

numeric. Values of blm to verify. More than one value is needed.

...

arguments inherited from inputData(), problem() and solve() functions.

Value

An object of class portfolio.

Details

evalblm() creates and solves multiple instances, of the corresponding multi-actions planning problem, for different values of blm. Alternatively, this could be obtained by executing function prioriactions() or by steps the inputData(), problem() and solve() functions; using, in each run, different blm values. However, the evalblm() function has two advantages with respect to this manual approach: : 1) it is more efficient to create the models (this is because the model is created just once and, at each iteration, only the blm values are updated); and 2) the output is a portfolio object, which allows obtaining information about the group of solutions (including all get functions).

Examples

# \donttest{
# set seed for reproducibility
set.seed(14)

## Create model and solve
port <- evalBlm(pu = sim_pu_data, features = sim_features_data,
                dist_features = sim_dist_features_data,
                threats = sim_threats_data,
                dist_threats = sim_dist_threats_data,
                sensitivity = sim_sensitivity_data,
                boundary = sim_boundary_data,
                values = c(0.0, 0.01, 0.02, 0.03),
                model_type = "minimizeCosts",
                time_limit = 50,
                output_file = FALSE,
                cores = 2)
#> *********************************
#>  Iteration 1 of 4: Blm0
#> *********************************
#> Warning: The blm argument was set to 0, so the boundary data has no effect
#> Warning: Some blm_actions argument were set to 0, so the boundary data has no effect for these cases
#> Rcplex: num variables=396 num constraints=284
#> *********************************
#>  Iteration 2 of 4: Blm0.01
#> *********************************
#> Warning: Some blm_actions argument were set to 0, so the boundary data has no effect for these cases
#> Rcplex: num variables=10296 num constraints=29984
#> *********************************
#>  Iteration 3 of 4: Blm0.02
#> *********************************
#> Warning: Some blm_actions argument were set to 0, so the boundary data has no effect for these cases
#> Rcplex: num variables=10296 num constraints=29984
#> *********************************
#>  Iteration 4 of 4: Blm0.03
#> *********************************
#> Warning: Some blm_actions argument were set to 0, so the boundary data has no effect for these cases
#> Rcplex: num variables=10296 num constraints=29984

getConnectivityPenalty(port)
#>   solution_name     units threat_1 threat_2
#> 1          Blm0 10299.201 2732.466 1556.262
#> 2       Blm0.01  6639.126 2984.187 1115.137
#> 3       Blm0.02         0 2890.835 1518.804
#> 4       Blm0.03         0 2890.835 1518.804
# }