Compare commits
No commits in common. "d0e970b2ab9b8d7bc6aee2b99e3e0906174f3c97" and "69ebb4fd01581c5643e379c2e84596bff8a15510" have entirely different histories.
d0e970b2ab
...
69ebb4fd01
3 changed files with 2 additions and 7 deletions
|
|
@ -157,9 +157,6 @@ public final class Node { //implements Comparable<Node> {
|
||||||
// return Integer.compare(getId(), other.getId());
|
// return Integer.compare(getId(), other.getId());
|
||||||
// }
|
// }
|
||||||
|
|
||||||
/*
|
|
||||||
* Remove a successor arc. Used for the marathon path-finding algorithm.
|
|
||||||
*/
|
|
||||||
public void removeArc(Arc arcToRemove) {
|
public void removeArc(Arc arcToRemove) {
|
||||||
successors.remove(arcToRemove);
|
successors.remove(arcToRemove);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,7 @@ public class Path {
|
||||||
* map do not match, or the end of a path is not the beginning of the
|
* map do not match, or the end of a path is not the beginning of the
|
||||||
* next).
|
* next).
|
||||||
*/
|
*/
|
||||||
public static Path concatenate(Path... paths) throws IllegalArgumentException {
|
public static Path concatenate(int indice, Path... paths) throws IllegalArgumentException {
|
||||||
if (paths.length == 0) {
|
if (paths.length == 0) {
|
||||||
throw new IllegalArgumentException("Cannot concatenate an empty list of paths.");
|
throw new IllegalArgumentException("Cannot concatenate an empty list of paths.");
|
||||||
}
|
}
|
||||||
|
|
@ -128,7 +128,7 @@ public class Path {
|
||||||
}
|
}
|
||||||
ArrayList<Arc> arcs = new ArrayList<>();
|
ArrayList<Arc> arcs = new ArrayList<>();
|
||||||
for (Path path: paths) {
|
for (Path path: paths) {
|
||||||
arcs.addAll(path.getArcs());
|
arcs.addAll(indice, path.getArcs());
|
||||||
}
|
}
|
||||||
Path path = new Path(paths[0].getGraph(), arcs);
|
Path path = new Path(paths[0].getGraph(), arcs);
|
||||||
if (!path.isValid()) {
|
if (!path.isValid()) {
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ import org.insa.graphs.model.Path;
|
||||||
import org.insa.graphs.model.RoadInformation;
|
import org.insa.graphs.model.RoadInformation;
|
||||||
import org.insa.graphs.model.RoadInformation.RoadType;
|
import org.insa.graphs.model.RoadInformation.RoadType;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Ignore;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
public class PathTest {
|
public class PathTest {
|
||||||
|
|
@ -84,7 +83,6 @@ public class PathTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = UnsupportedOperationException.class)
|
@Test(expected = UnsupportedOperationException.class)
|
||||||
@Ignore // Mutability required for marathon path-finding algo
|
|
||||||
public void testImmutability() {
|
public void testImmutability() {
|
||||||
emptyPath.getArcs().add(a2b);
|
emptyPath.getArcs().add(a2b);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue