Skip to content

Commit

Permalink
Solved incremental propagation bug in APSPSolver. --F.
Browse files Browse the repository at this point in the history
  • Loading branch information
federico.pecora@gmail.com committed Sep 17, 2013
1 parent 60138a7 commit 80fa8bf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Expand Up @@ -36,8 +36,8 @@ def getSvnRevision() {
}

//MetaCSP version
//version = '1.0.' + getSvnRevision()
version = '0.0.0-SNAPSHOT'
version = '1.0.' + getSvnRevision()
//version = '0.0.0-SNAPSHOT'
group = 'org.metacsp'

//Repos for dependencies
Expand Down
3 changes: 3 additions & 0 deletions create-bundle.sh
Expand Up @@ -2,6 +2,9 @@
pomFiles=`find artifacts/ -name *.pom`
jarFiles=`find artifacts/ -name *.jar`
ascFiles=`find artifacts/ -name *.asc`
if [ -d "bundleTemp" ]; then
rm -rf bundleTemp
fi
mkdir bundleTemp
for filename in $pomFiles
do
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/metacsp/time/APSPSolver.java
Expand Up @@ -726,12 +726,12 @@ private boolean incrementalDistanceMatrixComputation(int from,int to,Bounds i) {
long sum4 = sum(sum3,distance[to][v]);
long temp = Math.min(sum2,sum4);
if (distance[u][v] > temp) {
long oldD = distance[u][v];
//long oldD = distance[u][v];
distance[u][v] = temp;
if (u == v && distance[u][v] != 0) {
logger.info("==================> Updated distance[" + u + "][" + v + "] from " + oldD + " to " + temp);
//return false;
throw new Error("Found negative cycle in incremental propagation while adding (from,to,i) (" + from + "," + to + "," + i + ")");
//logger.info("==================> Updated distance[" + u + "][" + v + "] from " + oldD + " to " + temp);
//throw new Error("Found negative cycle in incremental propagation while adding (from,to,i) (" + from + "," + to + "," + i + ")");
return false;
}
}
}
Expand Down

0 comments on commit 80fa8bf

Please sign in to comment.