Skip to content

Commit

Permalink
Merge branch 'hotfix-4.10.17'
Browse files Browse the repository at this point in the history
  • Loading branch information
cprudhom committed Sep 23, 2024
2 parents 0f734bf + d9ac290 commit 49d21c5
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

Choco-solver is an open-source Java library for Constraint Programming.

Current stable version is 4.10.16 (12 Sep 2024).
Current stable version is 4.10.17 (23 Sep 2024).

Choco-solver comes with:
- various type of variables (integer, boolean, set, graph and real),
Expand Down Expand Up @@ -125,7 +125,7 @@ So you only have to edit your `pom.xml` to declare the following library depende
<dependency>
<groupId>org.choco-solver</groupId>
<artifactId>choco-solver</artifactId>
<version>4.10.16</version>
<version>4.10.17</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<groupId>org.choco-solver</groupId>
<artifactId>choco</artifactId>
<version>4.10.16</version>
<version>4.10.17</version>
</parent>
<artifactId>examples</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion parsers/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<groupId>org.choco-solver</groupId>
<artifactId>choco</artifactId>
<version>4.10.16</version>
<version>4.10.17</version>
</parent>
<artifactId>choco-parsers</artifactId>
<packaging>jar</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public Thread actionOnKill() {
@Override
public void createSolver() {
if (level.isLoggable(Level.COMPET)) {
System.out.println("%% Choco 240912_11:16");
System.out.println("%% Choco 240923_09:34");
}
super.createSolver();
datas = new Datas[nb_cores];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public Thread actionOnKill() {
public void createSolver() {
super.createSolver();
if (level.isLoggable(Level.COMPET)) {
System.out.println("c Choco 240912_11:16");
System.out.println("c Choco 240923_09:34");
}
String iname = Paths.get(instance).getFileName().toString();
parsers = new XCSPParser[nb_cores];
Expand Down
2 changes: 1 addition & 1 deletion parsers/src/main/minizinc/fzn-choco.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import sys

# THIS IS WHERE YOU NEED TO CHANGE THE PATH TO THE JAR FILE
JAR_FILE='~/.m2/repository/org/choco-solver/choco-parsers/4.10.16/choco-parsers-4.10.16-light.jar'
JAR_FILE='~/.m2/repository/org/choco-solver/choco-parsers/4.10.17/choco-parsers-4.10.17-light.jar'

JVM_ARGS = '-server -Xss64M -Xms2G -Xmx8G -XX:NewSize=512M'
LOG_LEVEL = 'COMPET'
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.choco-solver</groupId>
<artifactId>choco</artifactId>
<version>4.10.16</version>
<version>4.10.17</version>
<packaging>pom</packaging>
<name>choco</name>
<url>http://choco-solver.org/</url>
Expand Down
2 changes: 1 addition & 1 deletion solver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<groupId>org.choco-solver</groupId>
<artifactId>choco</artifactId>
<version>4.10.16</version>
<version>4.10.17</version>
</parent>
<artifactId>choco-solver</artifactId>
<packaging>jar</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ void reset() {
@Override
void support(int value) {
value -= offset;
ac.set(value);
if(value > -1) {
ac.set(value);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public interface IOutputFactory extends ISelf<Solver> {
* Default welcome message
*/
String WELCOME_MESSAGE =
"** Choco 4.10.16 (2024-09) : Constraint Programming Solver, Copyright (c) 2010-2024";
"** Choco 4.10.17 (2024-09) : Constraint Programming Solver, Copyright (c) 2010-2024";

/**
* Print the version message.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import org.chocosolver.solver.constraints.Constraint;
import org.chocosolver.solver.constraints.extension.Tuples;
import org.chocosolver.solver.constraints.extension.TuplesFactory;
import org.chocosolver.solver.constraints.extension.hybrid.HybridTuples;
import org.chocosolver.solver.constraints.extension.hybrid.ISupportable;
import org.chocosolver.solver.constraints.extension.nary.TuplesLargeTable;
import org.chocosolver.solver.constraints.extension.nary.TuplesTable;
import org.chocosolver.solver.constraints.extension.nary.TuplesVeryLargeTable;
Expand All @@ -33,12 +35,14 @@
import org.testng.annotations.Test;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Random;

import static java.lang.System.out;
import static org.chocosolver.solver.constraints.extension.TuplesFactory.generateTuples;
import static org.chocosolver.solver.constraints.extension.TuplesFactory.scalar;
import static org.chocosolver.solver.constraints.extension.hybrid.HybridTuples.*;
import static org.chocosolver.solver.search.strategy.Search.randomSearch;
import static org.testng.Assert.assertEquals;

Expand Down Expand Up @@ -942,4 +946,22 @@ public void testForbidden2(String a) {
Assert.assertEquals(model.getSolver().getSolutionCount(), (int) Math.pow(3, 3) - 3);
}

@Test(groups = "1s")
public void testHybrid() {
Model m = new Model();
IntVar[] intVars = m.intVarArray(3, 0, 5);
ISupportable[][] htuples = new ISupportable[][]{
{eq(1), gt(2), le(col(0))},
{eq(2), le(2), ne(col(1))}

};
HybridTuples ht = new HybridTuples();
ht.add(htuples);
m.table(intVars, ht).post();
for (int i = 0; i < 7; i++) {
m.getSolver().solve();
out.println(Arrays.toString(intVars));
}
}

}

0 comments on commit 49d21c5

Please sign in to comment.