démêlés divers avec AccessRestrictions

This commit is contained in:
Favary Pierre 2021-05-16 15:53:50 +02:00
parent 4e6be87c68
commit 65a01d5936

View file

@ -10,11 +10,13 @@ import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Arrays;
import java.util.EnumMap;
import org.insa.graphs.algorithm.ArcInspector;
import org.insa.graphs.algorithm.ArcInspectorFactory;
import org.insa.graphs.model.*;
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.io.BinaryGraphReader;
import org.insa.graphs.model.io.BinaryPathReader;
@ -52,12 +54,20 @@ public class DijkstraAlgorithmTest{
@BeforeClass
public static void initAll() throws IOException {
RoadInformation speed10 = new RoadInformation(RoadType.MOTORWAY, null, false, 36, ""),
speed20 = new RoadInformation(RoadType.MOTORWAY, null, false, 72, ""),
pietonable = new RoadInformation(RoadType.PEDESTRIAN, null, false, 5, "");
//gestion des restrictions pour pouvoir créer les Bellman-Ford
AccessRestrictions voiture, pedestre;
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, ""),
//toutes les routes ici sont à double sens
//visiblement un problème ave le deuxième argument null, comment gérer les restrictions?
// Create nodes
nodes = new Node[8];