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

Model analysis #939

Merged
merged 20 commits into from
Dec 2, 2022
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d11b7de
fix citation for AllDiffPrecMoreThanBc.java
ArthurGodet Aug 2, 2022
ffd68ce
Merge branch 'master' of https://github.com/chocoteam/choco-solver
ArthurGodet Oct 3, 2022
023096c
first version of Model.analyse method
ArthurGodet Oct 4, 2022
65a7ae0
create class ModelAnalyser + update statistics computation and storag…
ArthurGodet Oct 16, 2022
817081b
Merge branch 'master' of https://github.com/chocoteam/choco-solver in…
ArthurGodet Oct 17, 2022
a671385
remove JSON export from choco-solver and rename ModelAnalyserJson int…
ArthurGodet Oct 22, 2022
08aaf03
remove former Jackson imports
ArthurGodet Oct 22, 2022
d421455
finish removing jackson from chocosolver
ArthurGodet Oct 22, 2022
66e51c8
update ModelAnalyser API and add Javadoc to ModelAnalyser
ArthurGodet Oct 22, 2022
74dec48
remove nbConstants from variables analysis
ArthurGodet Oct 22, 2022
35f8cf6
add useful API to ModelAnalyser
ArthurGodet Oct 22, 2022
5f0e71c
fix compilation error in ModelAnalyser
ArthurGodet Oct 22, 2022
5460467
add byNbVars criterion to propagator analysis
ArthurGodet Oct 22, 2022
98fe1ac
add graph model analysis
ArthurGodet Oct 22, 2022
aa24b55
Merge branch 'master' of https://github.com/chocoteam/choco-solver in…
ArthurGodet Oct 22, 2022
c002169
Merge branch 'master' of https://github.com/chocoteam/choco-solver in…
ArthurGodet Oct 29, 2022
858886a
update ModelAnalyser printing using Solver.log()
ArthurGodet Oct 29, 2022
0cafccf
Merge branch 'master' into modelAnalysis
cprudhom Nov 18, 2022
df0b9be
Merge branch 'master' into modelAnalysis
ArthurGodet Nov 30, 2022
fcce8c6
Merge branch 'master' into modelAnalysis
cprudhom Dec 2, 2022
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
19 changes: 19 additions & 0 deletions solver/src/main/java/org/chocosolver/solver/Model.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@
import org.chocosolver.solver.objective.ObjectiveFactory;
import org.chocosolver.solver.propagation.PropagationEngine;
import org.chocosolver.solver.variables.*;
import org.chocosolver.solver.variables.view.IView;
import org.chocosolver.util.ESat;
import org.chocosolver.util.tools.VariableUtils;

import java.io.PrintStream;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;

Expand Down Expand Up @@ -173,6 +177,8 @@ public class Model implements IModel {
*/
private long seed = 0L;

private ModelAnalyser modelAnalyser = null;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// CONSTRUCTORS ///////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -663,6 +669,18 @@ public Settings getSettings() {
return this.settings;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Javadoc is missing

/**
* Return an analyser for the Model
*
* @return a {@link ModelAnalyser}
*/
public ModelAnalyser getModelAnalyser() {
if (this.modelAnalyser == null) {
this.modelAnalyser = new ModelAnalyser(this);
}
return this.modelAnalyser;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// SETTERS ////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -1066,4 +1084,5 @@ public void displayPropagatorOccurrences() {
public Model ref() {
return this;
}

}
Loading