Skip to content

Commit

Permalink
Add ValidationResult getReasonsFailed & getFailCount
Browse files Browse the repository at this point in the history
  • Loading branch information
rmartinsanta committed Dec 9, 2024
1 parent b7019cb commit 0bbe1e0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Developing
- (New) Objective class: a class that represents an objective function of a problem. Each Objective has a name, a direction (minimize or maximize), and functions for extracting the value of the objective from Moves and from Solutions. See docs for a detailed description.
- (New) Util methods: CollectionUtil::getBest(Iterable,ToDoubleFunction), ArrayUtil::stats(double[]), ArrayUtil::stats(int[]), ArrayUtil::stats(long[]), ReferenceResult::setScore(String, double)
- (New) Validator methods: getFailCount, getReasonsFailed
- (New) Support for AspectJ, first magic annotation @TimeStats implemented to measure the time of any method.
- (New) Ablation test: run ablation test by default after autoconfig procedure.
- (New) Irace plots: generate an HTML report with the results of running the autoconfig procedure.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import es.urjc.etsii.grafo.exception.InvalidSolutionException;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
Expand Down Expand Up @@ -35,6 +36,22 @@ public String getReasonFailed() {
return "Multiple failures: " + String.join("; ", this.reasonFailed);
}

/**
* Number of failed validations
* @return number of failed validations
*/
public int getFailCount() {
return this.reasonFailed.size();
}

/**
* Get all reasons why the validation failed
* @return list of reasons
*/
public List<String> getReasonsFailed() {
return Collections.unmodifiableList(this.reasonFailed);
}

private ValidationResult() {}

public void throwIfFail(){
Expand Down

0 comments on commit 0bbe1e0

Please sign in to comment.