Browse Source

Add new basic filter.

Mikael Capelle 3 years ago
parent
commit
fa7c65a6e6
1 changed files with 15 additions and 0 deletions
  1. 15
    0
      src/main/org/insa/algo/ArcFilterFactory.java

+ 15
- 0
src/main/org/insa/algo/ArcFilterFactory.java View File

@@ -47,6 +47,21 @@ public class ArcFilterFactory {
47 47
             }
48 48
         });
49 49
 
50
+        // 3. Non-private roads for pedestrian and bicycle:
51
+        filters.add(new ArcFilter() {
52
+            @Override
53
+            public boolean isAllowed(Arc arc) {
54
+                return arc.getRoadInformation().getAccessRestrictions()
55
+                        .isAllowedForAny(AccessMode.FOOT, EnumSet.complementOf(EnumSet
56
+                                .of(AccessRestriction.FORBIDDEN, AccessRestriction.PRIVATE)));
57
+            }
58
+
59
+            @Override
60
+            public String toString() {
61
+                return "Non-private roads for pedestrian.";
62
+            }
63
+        });
64
+
50 65
         // 3. Add your own filters here (do not forget to implement toString() to get an
51 66
         // understandable output!):
52 67
 

Loading…
Cancel
Save