Skip to content
Snippets Groups Projects
Commit 7819a99e authored by MASSAT Jean luc's avatar MASSAT Jean luc
Browse files

Clean

parent 5cbe4356
No related branches found
No related tags found
No related merge requests found
......@@ -46,3 +46,7 @@ bin/
/src/test/java/fr/univamu/solver/PrivateTestInterval.java
/src/test/java/fr/univamu/solver/PrivateTestReducer.java
/src/test/java/fr/univamu/solver/PrivateTestSolver.java
/src/main/java/fr/univamu/solver/PrivateBuilder.java
/src/main/java/fr/univamu/privateSolver/*
/src/test/java/fr/univamu/privateSolver/*
......@@ -5,10 +5,11 @@
</component>
<component name="ChangeListManager">
<list default="true" id="a17b64ea-8b68-4cd2-aba6-1780c674b35e" name="Changes" comment="Clean">
<change afterPath="$PROJECT_DIR$/src/main/java/fr/univamu/solver/ISolver.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gitignore" beforeDir="false" afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/gradle.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/gradle.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/fr/univamu/solver/Solver.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/fr/univamu/solver/Solver.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/java/fr/univamu/solver/TestSolver.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/fr/univamu/solver/TestSolver.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
......@@ -20,9 +21,57 @@
<ProjectState />
</projectState>
</component>
<component name="ExternalProjectsManager">
<system id="GRADLE">
<state>
<task path="$PROJECT_DIR$">
<activation />
</task>
<projects_view>
<tree_state>
<expand>
<path>
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
<item name="GL-Solver" type="f1a62948:ProjectNode" />
</path>
</expand>
<select />
</tree_state>
</projects_view>
</state>
</system>
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Record" />
<option value="Class" />
<option value="Interface" />
</list>
</option>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="GitLabMergeRequestFiltersHistory">{
&quot;lastFilter&quot;: {
&quot;state&quot;: &quot;OPENED&quot;,
&quot;assignee&quot;: {
&quot;type&quot;: &quot;org.jetbrains.plugins.gitlab.mergerequest.ui.filters.GitLabMergeRequestsFiltersValue.MergeRequestsMemberFilterValue.MergeRequestsAssigneeFilterValue&quot;,
&quot;username&quot;: &quot;massat&quot;,
&quot;fullname&quot;: &quot;MASSAT Jean luc&quot;
}
}
}</component>
<component name="GitLabMergeRequestsSettings">{
&quot;selectedUrlAndAccountId&quot;: {
&quot;first&quot;: &quot;git@etulab.univ-amu.fr:massat/gl-solver.git&quot;,
&quot;second&quot;: &quot;7a5f2ac7-26bf-451b-addf-84346e1e946e&quot;
}
}</component>
<component name="ProblemsViewState">
<option name="selectedTabId" value="CurrentFile" />
</component>
<component name="ProjectColorInfo">{
&quot;associatedIndex&quot;: 2
}</component>
......@@ -32,37 +81,153 @@
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;Gradle.GL-Solver [:fr.univamu.solver.Main.main()].executor&quot;: &quot;Run&quot;,
&quot;Gradle.Tests in 'GL-Solver'.executor&quot;: &quot;Run&quot;,
&quot;Gradle.Tests in 'fr.univamu.solver'.executor&quot;: &quot;Run&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;git-widget-placeholder&quot;: &quot;master&quot;,
&quot;kotlin-language-version-configured&quot;: &quot;true&quot;,
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"Gradle.Build GL-Solver.executor": "Run",
"Gradle.GL-Solver [:fr.univamu.solver.Main.main()].executor": "Run",
"Gradle.GL-Solver [build].executor": "Run",
"Gradle.PrivateTestSolver.executor": "Run",
"Gradle.PrivateTestSolver.test4Students.executor": "Run",
"Gradle.PrivateTestSolver.testErrorSolution.executor": "Run",
"Gradle.PrivateTestSolver.testOpti.executor": "Run",
"Gradle.PrivateTestSolver.testOptiSimple.executor": "Run",
"Gradle.PrivateTestSolver.testQueens8.executor": "Run",
"Gradle.PrivateTestSolver.testReduction.executor": "Run",
"Gradle.TestPrivateSolver.executor": "Run",
"Gradle.TestPrivateSolver.test1Students.executor": "Run",
"Gradle.TestPrivateSolver.test2Students.executor": "Run",
"Gradle.TestPrivateSolver.test4Students.executor": "Run",
"Gradle.TestPrivateSolver.testOpti.executor": "Run",
"Gradle.TestPrivateSolver.testOptimization.executor": "Run",
"Gradle.TestPrivateSolver.testPrivateSolver.executor": "Run",
"Gradle.TestPrivateSolver.testReduction.executor": "Run",
"Gradle.Tests in 'GL-Solver'.executor": "Run",
"Gradle.Tests in 'fr.univamu.solver'.executor": "Run",
"RunOnceActivity.ShowReadmeOnStart": "true",
"RunOnceActivity.git.unshallow": "true",
"git-widget-placeholder": "master",
"kotlin-language-version-configured": "true",
"last_opened_file_path": "/home/massat/Intellij/GL-Solver/src/main/java/fr/univamu/xxxx",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
"project.structure.last.edited": "Project",
"project.structure.proportion": "0.15",
"project.structure.side.proportion": "0.2",
"settings.editor.selected.configurable": "reference.settingsdialog.project.gradle",
"vue.rearranger.settings.migration": "true"
}
}</component>
}]]></component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/src/main/java/fr/univamu/xxxx" />
<recent name="$PROJECT_DIR$/src/main/java/fr/univamu/solver" />
</key>
<key name="CopyClassDialog.RECENTS_KEY">
<recent name="fr.univamu.privateSolver" />
<recent name="fr.univamu.xxxx" />
</key>
</component>
<component name="RunManager" selected="Gradle.Tests in 'GL-Solver'">
<configuration name="Main" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="fr.univamu.solver.Main" />
<module name="GL-Solver.main" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="fr.univamu.solver.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
<configuration name="TestPrivateSolver.test1Students" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value=":test" />
<option value="--tests" />
<option value="&quot;fr.univamu.privateSolver.TestPrivateSolver.test1Students&quot;" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>false</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>true</RunAsTest>
<method v="2" />
</configuration>
<configuration name="Tests in 'GL-Solver'" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<configuration name="TestPrivateSolver.test1Students" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value=":test" />
<option value="--tests" />
<option value="&quot;fr.univamu.privateSolver.TestPrivateSolver.test1Students&quot;" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>false</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>true</RunAsTest>
<method v="2" />
</configuration>
<configuration name="TestPrivateSolver.test2Students" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value=":test" />
<option value="--tests" />
<option value="&quot;fr.univamu.privateSolver.TestPrivateSolver.test2Students&quot;" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>false</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>true</RunAsTest>
<method v="2" />
</configuration>
<configuration name="TestPrivateSolver.test2Students" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value=":test" />
<option value="--tests" />
<option value="&quot;fr.univamu.privateSolver.TestPrivateSolver.test2Students&quot;" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>false</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>true</RunAsTest>
<method v="2" />
</configuration>
<configuration name="TestPrivateSolver.test4Students" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
......@@ -74,6 +239,8 @@
<option name="taskNames">
<list>
<option value=":test" />
<option value="--tests" />
<option value="&quot;fr.univamu.privateSolver.TestPrivateSolver.test4Students&quot;" />
</list>
</option>
<option name="vmOptions" />
......@@ -84,7 +251,7 @@
<RunAsTest>true</RunAsTest>
<method v="2" />
</configuration>
<configuration name="Tests in 'fr.univamu.solver'" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<configuration name="TestPrivateSolver.test4Students" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
......@@ -97,7 +264,99 @@
<list>
<option value=":test" />
<option value="--tests" />
<option value="&quot;fr.univamu.solver.*&quot;" />
<option value="&quot;fr.univamu.privateSolver.TestPrivateSolver.test4Students&quot;" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>false</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>true</RunAsTest>
<method v="2" />
</configuration>
<configuration name="TestPrivateSolver.testOpti" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value=":test" />
<option value="--tests" />
<option value="&quot;fr.univamu.privateSolver.TestPrivateSolver.testOpti&quot;" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>false</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>true</RunAsTest>
<method v="2" />
</configuration>
<configuration name="TestPrivateSolver.testOpti" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value=":test" />
<option value="--tests" />
<option value="&quot;fr.univamu.privateSolver.TestPrivateSolver.testOpti&quot;" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>false</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>true</RunAsTest>
<method v="2" />
</configuration>
<configuration name="Tests in 'GL-Solver'" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value=":test" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>false</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>true</RunAsTest>
<method v="2" />
</configuration>
<configuration name="Tests in 'GL-Solver'" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value=":test" />
</list>
</option>
<option name="vmOptions" />
......@@ -111,16 +370,18 @@
<recent_temporary>
<list>
<item itemvalue="Gradle.Tests in 'GL-Solver'" />
<item itemvalue="Gradle.Tests in 'fr.univamu.solver'" />
<item itemvalue="Application.Main" />
<item itemvalue="Gradle.TestPrivateSolver.testOpti" />
<item itemvalue="Gradle.TestPrivateSolver.test4Students" />
<item itemvalue="Gradle.TestPrivateSolver.test1Students" />
<item itemvalue="Gradle.TestPrivateSolver.test2Students" />
</list>
</recent_temporary>
</component>
<component name="SharedIndexes">
<attachedChunks>
<set>
<option value="bundled-jdk-9823dce3aa75-28b599e66164-intellij.indexing.shared.core-IU-242.23339.11" />
<option value="bundled-js-predefined-d6986cc7102b-5c90d61e3bab-JavaScript-IU-242.23339.11" />
<option value="bundled-jdk-9823dce3aa75-fdfe4dae3a2d-intellij.indexing.shared.core-IU-243.22562.218" />
<option value="bundled-js-predefined-d6986cc7102b-deb605915726-JavaScript-IU-243.22562.218" />
</set>
</attachedChunks>
</component>
......@@ -134,6 +395,29 @@
<updated>1727967430355</updated>
<workItem from="1727967431394" duration="6834000" />
<workItem from="1728024944251" duration="2652000" />
<workItem from="1728040954730" duration="5000" />
<workItem from="1728123345262" duration="458000" />
<workItem from="1728201158990" duration="1084000" />
<workItem from="1728390692872" duration="220000" />
<workItem from="1728401441929" duration="657000" />
<workItem from="1728402235461" duration="1455000" />
<workItem from="1728404017779" duration="4616000" />
<workItem from="1728412974116" duration="261000" />
<workItem from="1728459121253" duration="15078000" />
<workItem from="1728552052734" duration="1153000" />
<workItem from="1728574571500" duration="1807000" />
<workItem from="1728628311348" duration="388000" />
<workItem from="1728628706992" duration="7465000" />
<workItem from="1728898954770" duration="757000" />
<workItem from="1728912262164" duration="5827000" />
<workItem from="1728976979580" duration="7761000" />
<workItem from="1728990686795" duration="5353000" />
<workItem from="1729001677350" duration="5084000" />
<workItem from="1729063134462" duration="12979000" />
<workItem from="1729167435627" duration="76000" />
<workItem from="1729500223471" duration="1245000" />
<workItem from="1731343860000" duration="114000" />
<workItem from="1736264171106" duration="2061000" />
</task>
<task id="LOCAL-00001" summary="Create">
<option name="closed" value="true" />
......@@ -175,7 +459,15 @@
<option name="project" value="LOCAL" />
<updated>1727988463386</updated>
</task>
<option name="localTasksCounter" value="6" />
<task id="LOCAL-00006" summary="Clean">
<option name="closed" value="true" />
<created>1728032021786</created>
<option name="number" value="00006" />
<option name="presentableId" value="LOCAL-00006" />
<option name="project" value="LOCAL" />
<updated>1728032021786</updated>
</task>
<option name="localTasksCounter" value="7" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
......
package fr.univamu.solver;
public interface ISolver {
void reduceAndCheckIntervalsStrategy();
}
......@@ -37,7 +37,7 @@ class Constraint {
}
}
public class Solver {
public class Solver implements ISolver {
private static final int CHECK_INTERVALS_STRATEGY = 1;
private static final int REDUCE_AND_CHECK_INTERVALS_STRATEGY = 2;
......@@ -142,7 +142,7 @@ public class Solver {
return true;
}
public Variable findVariable() {
private Variable findVariable() {
Variable best = null;
for (Variable v : variables) {
if (v.isFixed()) continue;
......@@ -200,7 +200,7 @@ public class Solver {
return result;
}
public Variable newVar() {
private Variable newVar() {
var v = new Variable(variables.size());
variables.add(v);
return v;
......
......@@ -10,23 +10,23 @@ public class TestSolver {
@Test
public void testDomain() {
var solver = new Solver();
solver.newVar().domain(0, 9);
solver.newVar().domain(100, 109);
solver.newVar("X").domain(0, 9);
solver.newVar("Y").domain(100, 109);
assertEquals(100, solver.solve());
}
@Test
public void testDomainEmpty() {
var solver = new Solver();
solver.newVar().domain(20, 10);
solver.newVar("X").domain(20, 10);
assertEquals(0, solver.solve());
}
@Test
public void testConstraintAdd() {
var solver = new Solver();
var a = solver.newVar().domain(0, 9);
var b = solver.newVar().domain(0, 9);
var a = solver.newVar("a").domain(0, 9);
var b = solver.newVar("b").domain(0, 9);
solver.addConstraint(5, "=", a, "+", b);// 5=A+B
assertEquals(6, solver.solve());
}
......@@ -34,8 +34,8 @@ public class TestSolver {
@Test
public void testConstraintSub() {
var solver = new Solver();
var a = solver.newVar().domain(0, 9);
var b = solver.newVar().domain(0, 9);
var a = solver.newVar("a").domain(0, 9);
var b = solver.newVar("b").domain(0, 9);
solver.addConstraint(5, "=", a, "-", b);// 5=A-B
assertEquals(5, solver.solve());
}
......@@ -43,8 +43,8 @@ public class TestSolver {
@Test
public void testConstraintMul() {
var solver = new Solver();
var a = solver.newVar().domain(0, 9);
var b = solver.newVar().domain(0, 9);
var a = solver.newVar("a").domain(0, 9);
var b = solver.newVar("b").domain(0, 9);
solver.addConstraint(a, "=", b, "*", 2);// A=B*2
assertEquals(5, solver.solve());
}
......@@ -52,8 +52,8 @@ public class TestSolver {
@Test
public void testConstraintDiv() {
var solver = new Solver();
var a = solver.newVar().domain(0, 99);
var b = solver.newVar().domain(0, 9);
var a = solver.newVar("a").domain(0, 99);
var b = solver.newVar("b").domain(0, 9);
solver.addConstraint(a, "=", b, "/", 2);// A=B/2
assertEquals(10, solver.solve());
}
......@@ -61,8 +61,8 @@ public class TestSolver {
@Test
public void testConstraintEq() {
var solver = new Solver();
var a = solver.newVar().domain(0, 5);
var b = solver.newVar().domain(4, 9);
var a = solver.newVar("a").domain(0, 5);
var b = solver.newVar("b").domain(4, 9);
solver.addConstraint(a, "=", b);
assertEquals(2, solver.solve());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment