Skip to content

Commit

Permalink
Prepare XCSP3 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
cprudhom committed May 17, 2024
1 parent 2625212 commit 5fed63f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
22 changes: 16 additions & 6 deletions parsers/src/main/bash/xcsp3-exec
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/sh

NB_NODES=1
TIME_LIMIT=500
MEM_LIMIT=4000
DIR=./
LVL="COMPET"
DIR=/Users/kyzrsoze/Sources/CHOCO/continuous-branch/parsers/target/
TDIR=./
SEED=0
JAR_NAME=choco-parsers-light-4.10.9-SNAPSHOT.jar
JAR_NAME=choco-parsers-4.10.15-SNAPSHOT-light.jar
CHOCO_JAR=${DIR}/${JAR_NAME}
usage="\
Expand All @@ -19,6 +19,10 @@ OPTIONS:
-h, --help
Display this message.
-a
This causes the solver to search for, and output all solutions.
When this option is not given the solver should search for, and output the first solution or the best known one.
-dir <s>
Stands for the directory where the uploaded files reside.
The default is ${DIR}.
Expand Down Expand Up @@ -68,6 +72,8 @@ then
exit 1
fi

ARGS=""

while test $# -gt 0
do
case "$1" in
Expand All @@ -77,6 +83,10 @@ do
exit 0
;;

-a)
ARGS="$ARGS -a"
;;

-dir)
DIR="$2"
shift
Expand All @@ -88,7 +98,7 @@ do
;;

-p)
NB_NODES="$2"
ARGS="$ARGS -p $2"
shift
;;

Expand Down Expand Up @@ -132,10 +142,10 @@ do
done

FILE="$1"
ARGS=" -limit=[${TIME_LIMIT}s] -p $NB_NODES -f -varh DOMWDEG -valh BMIN -last -restarts [luby,500,5000] -lc 1"

ARGS="$ARGS -limit=[${TIME_LIMIT}s] -f -varh DOMWDEG -valsel [MIN,true,32,true] -restarts [luby,500,5000,true] -lc 1"

CMD="java -XX:+UseSerialGC -server -Xss128M -Xmx${MEM_LIMIT}m -cp .:${CHOCO_JAR} org.chocosolver.parser.xcsp.ChocoXCSP \"${FILE}\" ${ARGS}"

echo "c $CMD"
eval ${CMD}

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 231102");
System.out.println("c Choco 240517");
}
String iname = Paths.get(instance).getFileName().toString();
parsers = new XCSPParser[nb_cores];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1357,6 +1357,14 @@ public void buildCtrOrdered(String id, XVariables.XVarInteger[] list, XVariables
lexCtr(vectors, operator);
}

@Override
public void buildCtrLex(String id, XVariables.XVarInteger[] list, int[] limit, Types.TypeOperatorRel operator) {
IntVar[][] scopes = new IntVar[2][];
scopes[0] = vars(list);
scopes[1] = Arrays.stream(limit).mapToObj(l -> model.intVar(l)).toArray(IntVar[]::new);
lexCtr(scopes, operator);
}

@Override
public void buildCtrLex(String id, XVariables.XVarInteger[][] lists, Types.TypeOperatorRel operator) {
lexCtr(vars(lists), operator);
Expand Down

0 comments on commit 5fed63f

Please sign in to comment.