démêlés divers avec AccessRestrictions
This commit is contained in:
parent
4e6be87c68
commit
65a01d5936
1 changed files with 14 additions and 4 deletions
|
@ -10,11 +10,13 @@ import java.io.FileInputStream;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.EnumMap;
|
||||||
|
|
||||||
import org.insa.graphs.algorithm.ArcInspector;
|
import org.insa.graphs.algorithm.ArcInspector;
|
||||||
import org.insa.graphs.algorithm.ArcInspectorFactory;
|
import org.insa.graphs.algorithm.ArcInspectorFactory;
|
||||||
import org.insa.graphs.model.*;
|
import org.insa.graphs.model.*;
|
||||||
import org.insa.graphs.model.AccessRestrictions.AccessMode;
|
import org.insa.graphs.model.AccessRestrictions.AccessMode;
|
||||||
|
import org.insa.graphs.model.AccessRestrictions.AccessRestriction;
|
||||||
import org.insa.graphs.model.RoadInformation.RoadType;
|
import org.insa.graphs.model.RoadInformation.RoadType;
|
||||||
import org.insa.graphs.model.io.BinaryGraphReader;
|
import org.insa.graphs.model.io.BinaryGraphReader;
|
||||||
import org.insa.graphs.model.io.BinaryPathReader;
|
import org.insa.graphs.model.io.BinaryPathReader;
|
||||||
|
@ -52,12 +54,20 @@ public class DijkstraAlgorithmTest{
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void initAll() throws IOException {
|
public static void initAll() throws IOException {
|
||||||
|
|
||||||
RoadInformation speed10 = new RoadInformation(RoadType.MOTORWAY, null, false, 36, ""),
|
//gestion des restrictions pour pouvoir créer les Bellman-Ford
|
||||||
speed20 = new RoadInformation(RoadType.MOTORWAY, null, false, 72, ""),
|
AccessRestrictions voiture, pedestre;
|
||||||
pietonable = new RoadInformation(RoadType.PEDESTRIAN, null, false, 5, "");
|
AccessRestrictions.AccessRestriction authorise = AccessRestrictions.AccessRestriction.ALLOWED;
|
||||||
|
EnumMap<AccessMode, AccessRestrictions.AccessRestriction> pmap = null, vmap = null;
|
||||||
|
pmap.put(AccessMode.FOOT, authorise);
|
||||||
|
vmap.put(AccessMode.MOTORCAR, authorise);
|
||||||
|
pedestre = new AccessRestrictions(pmap);
|
||||||
|
voiture = new AccessRestrictions(vmap);
|
||||||
|
|
||||||
|
RoadInformation speed10 = new RoadInformation(RoadType.MOTORWAY, voiture, false, 36, ""),
|
||||||
|
speed20 = new RoadInformation(RoadType.MOTORWAY, voiture, false, 72, ""),
|
||||||
|
pietonable = new RoadInformation(RoadType.PEDESTRIAN, pedestre, false, 5, "");
|
||||||
//cyclable = new RoadInformation(RoadType.CYCLEWAY, null, false, 20, ""),
|
//cyclable = new RoadInformation(RoadType.CYCLEWAY, null, false, 20, ""),
|
||||||
//toutes les routes ici sont à double sens
|
//toutes les routes ici sont à double sens
|
||||||
//visiblement un problème ave le deuxième argument null, comment gérer les restrictions?
|
|
||||||
|
|
||||||
// Create nodes
|
// Create nodes
|
||||||
nodes = new Node[8];
|
nodes = new Node[8];
|
||||||
|
|
Loading…
Reference in a new issue