Skip to content

Commit

Permalink
Using maxTime > 0 with elitist=0 now gives a clear error rather than …
Browse files Browse the repository at this point in the history
…fail later (fix #65)
  • Loading branch information
MLopez-Ibanez committed Jan 6, 2024
1 parent 1ad3185 commit 39a1d8a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@
logFile has been renamed to `"instanceID"`. This data frame should not be
accessed directly. Instead use the new function
`get_instanceID_seed_pairs()`.


* Using `maxTime > 0` with `elitist=0` now gives a clear error rather than fail later (fix #65).


## New features and improvements

Expand Down
14 changes: 7 additions & 7 deletions R/readConfiguration.R
Original file line number Diff line number Diff line change
Expand Up @@ -668,10 +668,8 @@ checkScenario <- function(scenario = defaultScenario())
irace.error (quote.param(param), " must be a real value within [0, 1].")
}

if (!is.na(scenario$minExperiments)) {
scenario$maxExperiments <- max(scenario$maxExperiments,
scenario$minExperiments)
}
if (!is.na(scenario$minExperiments))
scenario$maxExperiments <- max(scenario$maxExperiments, scenario$minExperiments)

## Only maxExperiments or maxTime should be set. Negative values are not
## allowed.
Expand All @@ -690,10 +688,12 @@ checkScenario <- function(scenario = defaultScenario())

if (scenario$maxTime > 0 && (scenario$budgetEstimation <= 0 || scenario$budgetEstimation >= 1))
irace.error(quote.param("budgetEstimation"), " must be within (0,1).")

if (scenario$maxTime > 0 && !scenario$elitist)
irace.error(quote.param("maxTime"), " requires using 'elitist=1'")

if (is.na (scenario$softRestartThreshold)) {
scenario$softRestartThreshold <- 10^(- scenario$digits)
}
if (is.na(scenario$softRestartThreshold))
scenario$softRestartThreshold <- 10^(-scenario$digits)

if (scenario$deterministic &&
scenario$firstTest * scenario$blockSize > length(scenario$instances)) {
Expand Down

0 comments on commit 39a1d8a

Please sign in to comment.