heuristic-search-evaluation fails if targets not specified
Summary
when evaluating multiple runs with -Bcore:main=heuristic-search-evaluation
, error occurs if no target points file specified.
Component
search
Steps to reproduce
Run an example with heuristic-search-evaluation without targets
Current Behaviour
Error is thrown if no target points specified
Expected Behavior
The heuristic search evaluation should be possible without target points
Relevant logs and/or screenshots
20:17:15.475 [main] ERROR d.e.c.m.Evoal - Main class threw an exception.
java.lang.NullPointerException: Cannot invoke "java.util.List.size()" because "this.targets" is null
at de.evoal.optimisation.api@0.9.0-SNAPSHOT/de.evoal.optimisation.main.search.HeuristicSearchEvaluation.run(HeuristicSearchEvaluation.java:77)
Possible fixes
Line 77 of de.evoal.optimisation.main.search.HeuristicSearchEvaluation. When target points file is null, size can't be used for log. Moved it into the preceding if statement.
if(targetFile != null) {
PropertiesPairStreamSupplier targetStream = BeanFactory.create("target-stream", PropertiesPairStreamSupplier.class);
targets = targetStream.get().toList();
log.info("Processing {} targets during evaluation.", targets.size()); //new line
}
//log.info("Processing {} targets during evaluation.", targets.size()); old line
Contact Person
(Link a person/ people, that can answer questions about this issue, e.g. yourself)
/cc @berber