Skip to content

Commit 89c999d

Browse files
authored
Replace Cumulative implementation by state-of-the-art implementation of TimeTabling and OverloadChecking (#1165) and fixes #1114
1 parent 674e0e4 commit 89c999d

38 files changed

+3781
-2237
lines changed

.github/workflows/maven-test.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on: [push, pull_request]
77

88
jobs:
99
test-ibex:
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-latest
1111
# The different steps
1212
steps:
1313
- uses: actions/checkout@v4
@@ -27,7 +27,9 @@ jobs:
2727
2828
# Regression tests
2929
- name: Test Ibex
30-
run: mvn --file pom.xml test -Pcoverage -DtestFailureIgnore=true -Dgroups=ibex
30+
run: |
31+
export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib/ibex/3rd
32+
mvn --file pom.xml test -Pcoverage -DtestFailureIgnore=true -Dgroups=ibex
3133
3234
test-solver:
3335
runs-on: ubuntu-latest

CHANGES.md

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -70,23 +70,6 @@ See [milestone 5.0.0](https://github.com/chocoteam/choco-solver/milestone/40)
7070

7171
**Full Changelog**: https://github.com/chocoteam/choco-solver/compare/v4.10.17...v4.10.18
7272

73-
4.10.17 - 23 Sep 2024
74-
-------------------
75-
76-
### Hotfix
77-
- Fix bug in `PropHybridTable` (#1102)
78-
79-
**Full Changelog**: https://github.com/chocoteam/choco-solver/compare/v4.10.16...v4.10.17
80-
81-
4.10.16 - 12 Sep 2024
82-
-------------------
83-
84-
### Hotfix
85-
- Fix bug in `IntAffineView` (#1101)
86-
87-
**Full Changelog**: https://github.com/chocoteam/choco-solver/compare/v4.10.15...v4.10.16
88-
89-
9073
4.10.17 - 23 Sep 2024
9174
-------------------
9275

parsers/src/test/java/org/chocosolver/flatzinc/PerformanceTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010
package org.chocosolver.flatzinc;
1111

12+
import org.chocosolver.parser.Level;
1213
import org.chocosolver.parser.PerformanceListener;
1314
import org.chocosolver.parser.SetUpException;
1415
import org.chocosolver.parser.flatzinc.Flatzinc;
@@ -40,7 +41,7 @@ public class PerformanceTest {
4041
private static final String COMMENT = "#";
4142
private static final String DELIMITER = ",";
4243

43-
private static final String LEVEL = "SILENT";
44+
private static final String LEVEL = Level.SILENT.name();
4445

4546

4647
public Object[][] getInstances(String name) {

parsers/src/test/resources/flatzinc/instances.csv

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@
4646
2012,amaze+amaze+2012-06-22.fzn,1,928,321050,321049
4747
#2012,amaze+amaze+2012-07-04.fzn,1,481,244,243
4848
2012,fast-food+fastfood+ff3.fzn,195,1330,71699,71310
49-
2012,filters+filter+ar_1_2.fzn,4,18,28624,28617
49+
2012,filters+filter+ar_1_2.fzn,4,18,26682,26675
5050
2012,filters+filter+dct_1_1.fzn,1,34,49,48
5151
2012,filters+filter+ewf_1_1.fzn,1,28,37,36
5252
2012,filters+filter+fir16_1_1.fzn,1,35,34,33
5353
2012,filters+filter+fir_1_1.fzn,1,18,24,23
54-
2012,mspsp+mspsp+easy_01.fzn,5,26,1251640,1251631
55-
2012,mspsp+mspsp+medium_03.fzn,5,26,1251640,1251631
54+
2012,mspsp+mspsp+easy_01.fzn,5,26,1251641,1251632
55+
2012,mspsp+mspsp+medium_03.fzn,5,26,1251641,1251632
5656
2012,nonogram+non+non_fast_8.fzn,1,_,1932,1928
5757
2012,pattern-set-mining-k2+pattern_set_mining_k2+audiology.fzn,38,54,212187,212112
5858
2012,radiation+radiation+m06_15_15.fzn,1,711,307742,307741

parsers/src/test/resources/xcsp/instances.csv

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ basics;Cutstock-small.xml.lzma;2;4;21;18
2020
basics;Domino-300-300.xml.lzma;1;_;1;0
2121
basics;driverlogw-09.xml.lzma;1;_;1758;1211
2222
basics;Fapp-m2s-ex2_c18.xml.lzma;16;13871;282;180
23-
basics;Filters-dct_2_3.xml.lzma;19;16;3052;1704
24-
basics;FlexibleJobshop-easy01.xml.lzma;24;253;213;152
25-
basics;FlexibleJobshop-easy02.xml.lzma;64;11;6921;3059
23+
basics;Filters-dct_2_3.xml.lzma;19;16;2051;1100
24+
basics;FlexibleJobshop-easy01.xml.lzma;31;253;262;171
25+
basics;FlexibleJobshop-easy02.xml.lzma;59;11;5770;2403
2626
basics;Furniture.xml.lzma;1;603;33;32
2727
basics;GracefulGraph-K02-P04.xml.lzma;1;_;85;73
2828
basics;GraphColoring-3-fullins-4.xml.lzma;11;6;101587;76903
@@ -44,8 +44,8 @@ basics;MagicSquare-6-sum.xml.lzma;1;_;217;162
4444
basics;Mapping-full2x2_mp3.xml.lzma;1;1100;1345;1203
4545
basics;Mario-easy-4.xml.lzma;16;545;8705;8077
4646
#basics;MarketSplit-01.xml.lzma;0;_;1113575;919484
47-
basics;MSPSP-easy_01.xml.lzma;13;26;1421;650
48-
basics;MSPSP-hard_01.xml.lzma;4;35;305;229
47+
basics;MSPSP-easy_01.xml.lzma;14;26;1816;800
48+
basics;MSPSP-hard_01.xml.lzma;4;35;627;512
4949
basics;MultiKnapsack-1-0_X2.xml.lzma;1;_;2;0
5050
basics;MultiKnapsack-1-01.xml.lzma;1;_;2;0
5151
basics;NFC-12_2_10.xml.lzma;31;848;173;108
@@ -71,7 +71,7 @@ basics;QueenAttacking-06.xml.lzma;5;0;4307;3458
7171
basics;Queens-0008-m1.xml.lzma;1;_;31;27
7272
basics;RadarSurveillance-8-24-3-2-00.xml.lzma;1;_;92;22
7373
basics;Ramsey-12.xml.lzma;45;2;71913;41237
74-
basics;Rcpsp-j30-01-01_c18.xml.lzma;7;43;208;179
74+
basics;Rcpsp-j30-01-01_c18.xml.lzma;7;43;204;175
7575
basics;Rlfap-graph-04-opt_c18.xml.lzma;5;394;1492;801
7676
basics;RoomMate-sr0050-int.xml.lzma;1;_;2;0
7777
basics;SocialGolfers-4-3-4-cp.xml.lzma;1;_;225;151
@@ -82,11 +82,11 @@ basics;SteelMillSlab-m2-simple_c18.xml.lzma;1;0;70;50
8282
basics;SteelMillSlab-m2s-mini-simple_c18.xml.lzma;1;0;138;50
8383
basics;StillLife-03-06.xml.lzma;5;10;424;381
8484
basics;StillLife-wastage-03.xml.lzma;3;6;23;18
85-
basics;StripPacking-C1P1.xml.lzma;1;_;109846;80898
85+
basics;StripPacking-C1P1.xml.lzma;1;_;23702;17004
8686
basics;Subisomorphism-A-10.xml.lzma;1;_;30;28
8787
basics;Sudoku-s01a-alldiff.xml.lzma;1;_;1;0
8888
basics;SumColoring-myciel4_c18.xml.lzma;4;22;45690;42079
89-
basics;Taillard-os-04-04-0.xml.lzma;28;193;8848;7869
89+
basics;Taillard-os-04-04-0.xml.lzma;52;193;13313;11765
9090
basics;Tal-01_c18.xml.lzma;2;6;11;8
9191
basics;TeamAssignment-data1_4_6.xml.lzma;20;2948;11657;10545
9292
basics;TemplateDesign-m1-1_c18.xml.lzma;2;2;133;129

scripts/Ibex.dms

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM ubuntu:latest
2+
3+
# install Java 21
4+
RUN apt-get update && \
5+
apt-get install -y sudo openjdk-21-jdk-headless default-jdk python3 vim git maven curl g++ gcc flex bison cmake git pkg-config
6+
7+
RUN curl https://codeload.github.com/ibex-team/ibex-lib/tar.gz/ibex-2.9.1 > ibex-2.9.1.tar.gz && \
8+
tar -xzf ibex-2.9.1.tar.gz && \
9+
cd ibex-lib-ibex-2.9.1 && \
10+
# RUN #git clone https://github.com/ibex-team/ibex-lib.git && \
11+
# cd ibex-lib && \
12+
mkdir build && \
13+
cd build && \
14+
cmake -DLP_LIB=soplex -DBUILD_JAVA_INTERFACE=ON -DBUILD_SHARED_LIBS=ON -DJAVA_PACKAGE=org.chocosolver.solver.constraints.real .. && \
15+
make && \
16+
sudo make install && \
17+
export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib/ibex/3rd
18+
19+
RUN git clone --recurse-submodules https://github.com/chocoteam/choco-solver.git && \
20+
cd choco-solver && \
21+
# git checkout develop && \
22+
mvn -q clean install -DskipTests
23+
RUN cd choco-solver && \
24+
# exporting LD_LIBRARY_PATH twice (or at least here) is mandatory
25+
export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib/ibex/3rd && \
26+
mvn --file pom.xml test -DtestFailureIgnore=true -Dgroups=ibex

scripts/install-ibex.sh

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
#!/usr/bin/env bash
22
set -ex
33
# download Ibex and untar it
4-
ibexver=2.8.8
5-
ibexjavaver=1.2.0
4+
root=$(pwd)
5+
ibexver=2.9.1
66
curl https://codeload.github.com/ibex-team/ibex-lib/tar.gz/ibex-${ibexver} > ibex-${ibexver}.tar.gz
77
tar -xzf ibex-${ibexver}.tar.gz
8-
curl https://codeload.github.com/ibex-team/ibex-java/tar.gz/${ibexjavaver} > ibex-java-${ibexjavaver}.tar.gz
9-
tar -xzf ibex-java-${ibexjavaver}.tar.gz --directory ibex-lib-ibex-${ibexver}/plugins/
8+
109
# prepare installation
1110
cd ibex-lib-ibex-${ibexver}
12-
./waf configure --enable-shared --with-jni --java-package-name=org.chocosolver.solver.constraints.real
13-
./waf build
14-
sudo ./waf install
15-
export LD_LIBRARY_PATH=/usr/local/lib
16-
cd -
11+
mkdir build
12+
cd build
13+
cmake -DLP_LIB=soplex -DBUILD_JAVA_INTERFACE=ON -DBUILD_SHARED_LIBS=ON -DJAVA_PACKAGE=org.chocosolver.solver.constraints.real ..
14+
make
15+
sudo make install
16+
export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib/ibex/3rd
17+
18+
cd ${root}
1719
sudo rm -r ibex-${ibexver}.tar.gz
18-
sudo rm -r ibex-java-${ibexjavaver}.tar.gz
1920

2021
ibexsolve -v

solver/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
<configuration>
115115
<!--suppress UnresolvedMavenProperty -->
116116
<!-- <argLine>${argLine} -Xms384m -Xmx768m -Djava.library.path=/usr/local/lib</argLine>-->
117-
<argLine>${argLine} -Djava.library.path=/usr/local/lib</argLine>
117+
<argLine>${argLine} -Djava.library.path=/usr/local/lib:/usr/local/lib/ibex/3rd</argLine>
118118
<properties>
119119
<property>
120120
<name>listener</name>

solver/src/main/java/org/chocosolver/solver/Solver.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,6 @@ private boolean initialize() {
401401
M.setTopDecisionPosition(0);
402402
pushTrail(); // store state before initial propagation; w = 0 -> 1
403403
try {
404-
checkTasks();
405404
mMeasures.incFixpointCount();
406405
// check sat
407406
if (isLCG() && !getSat().ok_) {
@@ -569,16 +568,6 @@ private void checkExplainedConstraints() {
569568
}
570569
}
571570

572-
private void checkTasks() throws ContradictionException {
573-
if (mModel.getHook(Model.TASK_SET_HOOK_NAME) != null) {
574-
//noinspection unchecked
575-
ArrayList<Task> tset = (ArrayList<Task>) mModel.getHook(Model.TASK_SET_HOOK_NAME);
576-
for (int i = 0; i < tset.size(); i++) {
577-
tset.get(i).ensureBoundConsistency();
578-
}
579-
}
580-
}
581-
582571
/**
583572
* Push a world on the environment's stack, and same for MiniSat if relevant
584573
*/
@@ -836,7 +825,6 @@ public void propagate() throws ContradictionException {
836825
if (!engine.isInitialized()) {
837826
engine.initialize();
838827
}
839-
checkTasks();
840828
try {
841829
engine.propagate();
842830
} finally {

solver/src/main/java/org/chocosolver/solver/constraints/IConstraintFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*
2323
* @author Jean-Guillaume FAGES
2424
*/
25-
public interface IConstraintFactory extends IIntConstraintFactory, IRealConstraintFactory, ISetConstraintFactory, IGraphConstraintFactory {
25+
public interface IConstraintFactory extends IIntConstraintFactory, IRealConstraintFactory, ISchedulingFactory, ISetConstraintFactory, IGraphConstraintFactory {
2626

2727
/**
2828
* Create a constraint that acts as an observer.

0 commit comments

Comments
 (0)