Skip to content

Commit

Permalink
fix: spec and minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zepfred committed Nov 14, 2024
1 parent e11de80 commit 4a7a34a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions benchmark/src/main/resources/benchmark.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -587,10 +587,10 @@
<xs:element minOccurs="0" name="moveCountLimit" type="xs:long"/>


<xs:element minOccurs="0" name="flatLineDetectionRatio" type="xs:double"/>
<xs:element minOccurs="0" name="stopFlatLineDetectionRatio" type="xs:double"/>


<xs:element minOccurs="0" name="newCurveDetectionRatio" type="xs:double"/>
<xs:element minOccurs="0" name="noStopFlatLineDetectionRatio" type="xs:double"/>


<xs:element minOccurs="0" name="minimalExecutionTimeSeconds" type="xs:long"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ public final class UnimprovedBestSolutionTermination<Solution_> extends Abstract
protected Boolean terminate;

public UnimprovedBestSolutionTermination(Double stopFlatLineDetectionRatio,
Double noStopFlatLineDetectionRatio, Long minimalExecutionTimeSeconds) {
Double noStopFlatLineDetectionRatio, Long minimalExecutionTimeSeconds) {
this(stopFlatLineDetectionRatio, noStopFlatLineDetectionRatio, minimalExecutionTimeSeconds, Clock.systemUTC());
}

public UnimprovedBestSolutionTermination(Double stopFlatLineDetectionRatio, Double noStopFlatLineDetectionRatio,
Long minimalExecutionTimeSeconds, Clock clock) {
Long minimalExecutionTimeSeconds, Clock clock) {
this.stopFlatLineDetectionRatio = Objects.requireNonNull(stopFlatLineDetectionRatio,
"The field stopFlatLineDetectionRatio is required for the termination UnimprovedBestSolutionTermination");
this.noStopFlatLineDetectionRatio = Objects.requireNonNull(noStopFlatLineDetectionRatio,
Expand Down Expand Up @@ -137,7 +137,7 @@ public boolean isPhaseTerminated(AbstractPhaseScope<Solution_> phaseScope) {
initialCurvePointMillis = lastImprovementMillis;
previousBest = currentBest;
if (logger.isInfoEnabled()) {
logger.debug("Starting a new curve with ({}), estimated time interval ({}s)",
logger.debug("Starting a new curve with ({}), time interval ({}s)",
previousBest,
String.format("%.2f", completeInterval / 1000.0));
}
Expand Down Expand Up @@ -191,6 +191,7 @@ public UnimprovedBestSolutionTermination<Solution_> createChildThreadTermination

@Override
public String toString() {
return "UnimprovedBestSolutionTermination(%.2f, %.2f)".formatted(stopFlatLineDetectionRatio, noStopFlatLineDetectionRatio);
return "UnimprovedBestSolutionTermination(%.2f, %.2f)".formatted(stopFlatLineDetectionRatio,
noStopFlatLineDetectionRatio);
}
}
4 changes: 2 additions & 2 deletions core/src/main/resources/solver.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@

<xs:element minOccurs="0" name="moveCountLimit" type="xs:long"/>

<xs:element minOccurs="0" name="flatLineDetectionRatio" type="xs:double"/>
<xs:element minOccurs="0" name="stopFlatLineDetectionRatio" type="xs:double"/>

<xs:element minOccurs="0" name="newCurveDetectionRatio" type="xs:double"/>
<xs:element minOccurs="0" name="noStopFlatLineDetectionRatio" type="xs:double"/>

<xs:element minOccurs="0" name="minimalExecutionTimeSeconds" type="xs:long"/>

Expand Down

0 comments on commit 4a7a34a

Please sign in to comment.