Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add new move count metric #1072

Merged
merged 26 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f10ca87
feat: add move count metric
zepfred Sep 4, 2024
da89485
feat: simplify count metric and add benchmark support
zepfred Sep 5, 2024
f854f4b
chore: fix doc
zepfred Sep 5, 2024
303cd3a
feat: support benchmark report
zepfred Sep 5, 2024
1027683
feat: add termination config
zepfred Sep 6, 2024
261b46b
fix: NPE when checking the move count
zepfred Sep 6, 2024
de34ea4
chore: minor improvement
zepfred Sep 6, 2024
1bfbd3e
chore: PR comments
zepfred Sep 6, 2024
f8364f3
feat: improve the metric logic
zepfred Sep 6, 2024
17c9806
chore: address sonarcloud issues
zepfred Sep 6, 2024
96f134d
feat: improve the metric logic
zepfred Sep 9, 2024
eb40154
chore: address sonarcloud issues
zepfred Sep 9, 2024
368a9b4
fix: formatting
zepfred Sep 9, 2024
279df7a
docs: new metric doc
zepfred Sep 10, 2024
cea21f9
chore: address sonarcloud issues
zepfred Sep 10, 2024
caf9ded
chore: address PR comments
zepfred Sep 16, 2024
ca26741
chore: log move speed by default
zepfred Sep 19, 2024
db888d8
feat: new metric count per move type
zepfred Sep 23, 2024
ca14115
FIX: improve tests and unregister logic
zepfred Sep 23, 2024
02f55d6
doc: add new metric documentation
zepfred Sep 24, 2024
c7cc9c9
fix: fix tests
zepfred Sep 24, 2024
b24d6e9
chore: addressing PR comments
zepfred Sep 25, 2024
67179d0
chore: addressing PR comments
zepfred Sep 25, 2024
8673c33
chore: addressing PR comments
zepfred Sep 25, 2024
0ebfa91
chore: addressing PR comments
zepfred Sep 25, 2024
71f1327
Don't proliferate the metric switching
triceo Sep 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ public void setBestSolutionStepIndex(int bestSolutionStepIndex) {

public abstract AbstractStepScope<Solution_> getLastCompletedStepScope();

public boolean isEnableCollectMetrics() {
/**
* @return true, if the metrics collection, such as
* {@link ai.timefold.solver.core.config.solver.monitoring.SolverMetric#MOVE_COUNT_PER_TYPE MOVE_COUNT_PER_TYPE},
* is enabled; false, if the collection is disabled for the phase.
*/
public boolean isMetricCollectionEnabled() {
return enableCollectMetrics;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void setBestScoreImproved(Boolean bestScoreImproved) {
}

public void incrementMoveEvaluationCount(Move<?> move) {
if (getPhaseScope().isEnableCollectMetrics()) {
if (getPhaseScope().isMetricCollectionEnabled()) {
getPhaseScope().getSolverScope().addMoveEvaluationCount(1L);
if (getPhaseScope().getSolverScope().isMetricEnabled(SolverMetric.MOVE_COUNT_PER_TYPE)) {
getPhaseScope().getSolverScope().incrementMoveEvaluationCountPerType(move);
Expand Down
Loading