diff --git a/AspectedRouting.Test/ExamplesTest.cs b/AspectedRouting.Test/ExamplesTest.cs new file mode 100644 index 0000000..29e1aed --- /dev/null +++ b/AspectedRouting.Test/ExamplesTest.cs @@ -0,0 +1,16 @@ +using Xunit; + +namespace AspectedRouting.Test +{ + public class ExamplesTest + { + [Fact] + public void Integration_TestExamples() + { + var input = "./Examples/"; + var output = "./output/"; + var err = Program.MainWithError(new[] {input, output, "--no-repl"}); + Assert.Null(err); + } + } +} \ No newline at end of file diff --git a/AspectedRouting.sln.DotSettings.user b/AspectedRouting.sln.DotSettings.user index 3afa92e..3f86a8f 100644 --- a/AspectedRouting.sln.DotSettings.user +++ b/AspectedRouting.sln.DotSettings.user @@ -1,5 +1,10 @@  <SessionState ContinuousTestingIsOn="False" ContinuousTestingMode="0" FrameworkVersion="{x:Null}" IsLocked="False" Name="ParseFunction_Duration_TotalMinutes" PlatformMonoPreference="{x:Null}" PlatformType="{x:Null}" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Project Location="/home/pietervdvn/werk/AspectedRouting/AspectedRouting.Test" Presentation="&lt;AspectedRouting.Test&gt;" /> +</SessionState> + <SessionState ContinuousTestingIsOn="False" ContinuousTestingMode="0" FrameworkVersion="{x:Null}" IsLocked="False" Name="Integration_TestExamples" PlatformMonoPreference="{x:Null}" PlatformType="{x:Null}" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> + <TestAncestor> + <TestId>xUnit::A1309041-8AAE-42D7-A886-94C9FFC6A28C::.NETCoreApp,Version=v3.1::AspectedRouting.Test.ExamplesTest.Integration_TestExamples</TestId> + </TestAncestor> </SessionState> \ No newline at end of file diff --git a/AspectedRouting/AspectedRouting.csproj b/AspectedRouting/AspectedRouting.csproj index 16b890c..925f715 100644 --- a/AspectedRouting/AspectedRouting.csproj +++ b/AspectedRouting/AspectedRouting.csproj @@ -12,10 +12,7 @@ PreserveNewest - - PreserveNewest - - + PreserveNewest diff --git a/AspectedRouting/AspectedRouting.csproj.DotSettings b/AspectedRouting/AspectedRouting.csproj.DotSettings new file mode 100644 index 0000000..3fc2808 --- /dev/null +++ b/AspectedRouting/AspectedRouting.csproj.DotSettings @@ -0,0 +1,2 @@ + + True \ No newline at end of file diff --git a/Profiles/Format.md b/AspectedRouting/Examples/Format.md similarity index 100% rename from Profiles/Format.md rename to AspectedRouting/Examples/Format.md diff --git a/Profiles/bicycle/aspects/bicycle.comfort.json b/AspectedRouting/Examples/bicycle/aspects/bicycle.comfort.json similarity index 100% rename from Profiles/bicycle/aspects/bicycle.comfort.json rename to AspectedRouting/Examples/bicycle/aspects/bicycle.comfort.json diff --git a/Profiles/bicycle/aspects/bicycle.legal_access.json b/AspectedRouting/Examples/bicycle/aspects/bicycle.legal_access.json similarity index 98% rename from Profiles/bicycle/aspects/bicycle.legal_access.json rename to AspectedRouting/Examples/bicycle/aspects/bicycle.legal_access.json index 4ab8e59..eb27932 100644 --- a/Profiles/bicycle/aspects/bicycle.legal_access.json +++ b/AspectedRouting/Examples/bicycle/aspects/bicycle.legal_access.json @@ -37,6 +37,7 @@ "pedestrian": "dismount", "corridor": "dismount", "construction": "dismount", + "steps": "dismount", "path": "yes", "primary": "yes", "primary_link": "yes", diff --git a/Profiles/bicycle/aspects/bicycle.network_is_nodenetwork.json b/AspectedRouting/Examples/bicycle/aspects/bicycle.network_is_nodenetwork.json similarity index 100% rename from Profiles/bicycle/aspects/bicycle.network_is_nodenetwork.json rename to AspectedRouting/Examples/bicycle/aspects/bicycle.network_is_nodenetwork.json diff --git a/Profiles/bicycle/aspects/bicycle.oneway.json b/AspectedRouting/Examples/bicycle/aspects/bicycle.oneway.json similarity index 100% rename from Profiles/bicycle/aspects/bicycle.oneway.json rename to AspectedRouting/Examples/bicycle/aspects/bicycle.oneway.json diff --git a/Profiles/bicycle/aspects/bicycle.safety.json b/AspectedRouting/Examples/bicycle/aspects/bicycle.safety.json similarity index 100% rename from Profiles/bicycle/aspects/bicycle.safety.json rename to AspectedRouting/Examples/bicycle/aspects/bicycle.safety.json diff --git a/Profiles/bicycle/aspects/bicycle.speed_factor.json b/AspectedRouting/Examples/bicycle/aspects/bicycle.speed_factor.json similarity index 87% rename from Profiles/bicycle/aspects/bicycle.speed_factor.json rename to AspectedRouting/Examples/bicycle/aspects/bicycle.speed_factor.json index 54d8b55..c61d4f5 100644 --- a/Profiles/bicycle/aspects/bicycle.speed_factor.json +++ b/AspectedRouting/Examples/bicycle/aspects/bicycle.speed_factor.json @@ -12,9 +12,14 @@ "#": "an unmaintained track (in Belgium: tractor path) is slower as well", "track": 0.7, "#": "A road under construction slows one down, despite (normally) already being dismount", - "construction": 0.5 + "construction": 0.5, + "steps": 0.1 }, - "surface": { + "ramp:bicycle": { + "#": "These are stairs (highway=steps), but there is a bicycle ramp, so we go a little bit faster", + "yes": 3 + }, + "surface": { "paved": 0.99, "asphalt": 1, "concrete": 1, diff --git a/AspectedRouting/Examples/bicycle/bicycle.json b/AspectedRouting/Examples/bicycle/bicycle.json new file mode 100644 index 0000000..23c2195 --- /dev/null +++ b/AspectedRouting/Examples/bicycle/bicycle.json @@ -0,0 +1,95 @@ +{ + "name": "bicycle", + "description": "Profile for a normal bicycle", + "vehicletypes": [ + "vehicle", + "bicycle" + ], + "metadata": [ + "name", + "bridge", + "tunnel", + "colour", + "cycle_network_colour", + "cycle_network_ref", + "ref", + "status", + "network" + ], + "access": "$bicycle.legal_access", + "oneway": "$bicycle.oneway", + "speed": { + "$max": [ + "$ferry_speed", + { + "$min": [ + "$legal_maxspeed_be", + "#maxspeed", + { + "$multiply": [ + "#defaultSpeed", + "$bicycle.speed_factor" + ] + } + ] + } + ] + }, + "priority": { + "#comfort": "$bicycle.comfort", + "#safety": "$bicycle.safety", + "#nodeNetworkScore": "$bicycle.network_is_nodenetwork", + "#timeNeeded": "$speed", + "#distance": "$distance", + "#trespassingPenalty": "$clean_permission_score", + "#leastSafetyPenalty": { + "$multiply": [ + "$speed", + { + "$atleast": "#leastSafetyRequired", + "f": "$bicycle.safety", + "then": 0, + "else": -1 + } + ] + } + }, + "defaults": { + "#defaultSpeed": 15, + "#maxspeed": 30, + "#timeNeeded": 0, + "#distance": 0, + "#comfort": 0, + "#safety": 0, + "#operatorNetworkScore": 0, + "#networkOperator": [], + "#cycleHighwayNetworkScore": 0, + "#nodeNetworkScore": 0, + "#bicycleNetworkScore": 0, + "#trespassingPenalty": 15, + "#": "This isn't a weight, but is used as cut-off in 'leastSafetyPenalty'", + "#leastSafetyRequired": 0.11, + "#leastSafetyPenalty": 2 + }, + "behaviours": { + "fastest": { + "description": "The fastest route to your destination", + "#timeNeeded": 1, + "#leastSafetyPenalty": 2 + }, + "shortest": { + "description": "The shortest route, independent of of speed", + "#distance": 1, + "#leastSafetyPenalty": 2 + }, + "comfort": { + "description": "A comfortable route preferring well-paved roads, smaller roads and a bit of scenery at the cost of speed", + "#comfort": 1 + }, + "node_network": { + "description": "A route following the recreational node network. Might make detours", + "#nodeNetworkScore": 10, + "#safety": 1 + } + } +} diff --git a/Profiles/bicycle/tests/bicycle.comfort.test.csv b/AspectedRouting/Examples/bicycle/tests/bicycle.comfort.test.csv similarity index 100% rename from Profiles/bicycle/tests/bicycle.comfort.test.csv rename to AspectedRouting/Examples/bicycle/tests/bicycle.comfort.test.csv diff --git a/Profiles/bicycle/tests/bicycle.fastest.behaviour_test.csv b/AspectedRouting/Examples/bicycle/tests/bicycle.fastest.behaviour_test.csv similarity index 100% rename from Profiles/bicycle/tests/bicycle.fastest.behaviour_test.csv rename to AspectedRouting/Examples/bicycle/tests/bicycle.fastest.behaviour_test.csv diff --git a/Profiles/bicycle/tests/bicycle.legal_access.test.csv b/AspectedRouting/Examples/bicycle/tests/bicycle.legal_access.test.csv similarity index 100% rename from Profiles/bicycle/tests/bicycle.legal_access.test.csv rename to AspectedRouting/Examples/bicycle/tests/bicycle.legal_access.test.csv diff --git a/Profiles/bicycle/tests/bicycle.networks.behaviour_test.csv b/AspectedRouting/Examples/bicycle/tests/bicycle.networks.behaviour_test.csv similarity index 100% rename from Profiles/bicycle/tests/bicycle.networks.behaviour_test.csv rename to AspectedRouting/Examples/bicycle/tests/bicycle.networks.behaviour_test.csv diff --git a/Profiles/bicycle/tests/bicycle.oneway.test.csv b/AspectedRouting/Examples/bicycle/tests/bicycle.oneway.test.csv similarity index 100% rename from Profiles/bicycle/tests/bicycle.oneway.test.csv rename to AspectedRouting/Examples/bicycle/tests/bicycle.oneway.test.csv diff --git a/Profiles/bicycle/tests/bicycle.safety.test.csv b/AspectedRouting/Examples/bicycle/tests/bicycle.safety.test.csv similarity index 100% rename from Profiles/bicycle/tests/bicycle.safety.test.csv rename to AspectedRouting/Examples/bicycle/tests/bicycle.safety.test.csv diff --git a/Profiles/bicycle/tests/bicycle.shortest.behaviour_test.csv b/AspectedRouting/Examples/bicycle/tests/bicycle.shortest.behaviour_test.csv similarity index 100% rename from Profiles/bicycle/tests/bicycle.shortest.behaviour_test.csv rename to AspectedRouting/Examples/bicycle/tests/bicycle.shortest.behaviour_test.csv diff --git a/Profiles/bicycle/tests/bicycle.speed_factor.test.csv b/AspectedRouting/Examples/bicycle/tests/bicycle.speed_factor.test.csv similarity index 100% rename from Profiles/bicycle/tests/bicycle.speed_factor.test.csv rename to AspectedRouting/Examples/bicycle/tests/bicycle.speed_factor.test.csv diff --git a/Profiles/general/clean_permission_score.json b/AspectedRouting/Examples/general/clean_permission_score.json similarity index 100% rename from Profiles/general/clean_permission_score.json rename to AspectedRouting/Examples/general/clean_permission_score.json diff --git a/Profiles/general/clean_permission_score.test.csv b/AspectedRouting/Examples/general/clean_permission_score.test.csv similarity index 100% rename from Profiles/general/clean_permission_score.test.csv rename to AspectedRouting/Examples/general/clean_permission_score.test.csv diff --git a/Profiles/general/ferry_speed.json b/AspectedRouting/Examples/general/ferry_speed.json similarity index 100% rename from Profiles/general/ferry_speed.json rename to AspectedRouting/Examples/general/ferry_speed.json diff --git a/Profiles/general/ferry_speed.test.csv b/AspectedRouting/Examples/general/ferry_speed.test.csv similarity index 100% rename from Profiles/general/ferry_speed.test.csv rename to AspectedRouting/Examples/general/ferry_speed.test.csv diff --git a/Profiles/general/legal_maxspeed_be.json b/AspectedRouting/Examples/general/legal_maxspeed_be.json similarity index 100% rename from Profiles/general/legal_maxspeed_be.json rename to AspectedRouting/Examples/general/legal_maxspeed_be.json diff --git a/Profiles/general/legal_maxspeed_be.test.csv b/AspectedRouting/Examples/general/legal_maxspeed_be.test.csv similarity index 100% rename from Profiles/general/legal_maxspeed_be.test.csv rename to AspectedRouting/Examples/general/legal_maxspeed_be.test.csv diff --git a/Profiles/pedestrian/aspects/pedestrian.legal_access.json b/AspectedRouting/Examples/pedestrian/aspects/pedestrian.legal_access.json similarity index 100% rename from Profiles/pedestrian/aspects/pedestrian.legal_access.json rename to AspectedRouting/Examples/pedestrian/aspects/pedestrian.legal_access.json diff --git a/Profiles/pedestrian/pedestrian.json b/AspectedRouting/Examples/pedestrian/pedestrian.json similarity index 79% rename from Profiles/pedestrian/pedestrian.json rename to AspectedRouting/Examples/pedestrian/pedestrian.json index 1267505..e62b450 100644 --- a/Profiles/pedestrian/pedestrian.json +++ b/AspectedRouting/Examples/pedestrian/pedestrian.json @@ -20,7 +20,6 @@ "priority": { "#timeNeeded": "$speed", "#distance": "$distance", - "#slow_road_preference": "$pedestrian.slow_road_preference", "#trespassingPenalty": "$clean_permission_score" }, "defaults": { @@ -36,10 +35,6 @@ "description": "The shortest route, independent of of speed", "#distance": 1, "#leastSafetyPenalty": 2 - }, - "slow_roads": { - "description": "A route prefering pedestrian-oriented infrastructure", - "#slow_road_preference": 1 } } } diff --git a/Profiles/pedestrian/tests/pedestrian.legal_access.test.csv b/AspectedRouting/Examples/pedestrian/tests/pedestrian.legal_access.test.csv similarity index 100% rename from Profiles/pedestrian/tests/pedestrian.legal_access.test.csv rename to AspectedRouting/Examples/pedestrian/tests/pedestrian.legal_access.test.csv diff --git a/Profiles/pedestrian/tests/pedestrian.slow_roads.behaviour_test.csv b/AspectedRouting/Examples/pedestrian/tests/pedestrian.slow_roads.behaviour_test.csv similarity index 100% rename from Profiles/pedestrian/tests/pedestrian.slow_roads.behaviour_test.csv rename to AspectedRouting/Examples/pedestrian/tests/pedestrian.slow_roads.behaviour_test.csv diff --git a/AspectedRouting/Program.cs b/AspectedRouting/Program.cs index 7de3f96..8ccf0d2 100644 --- a/AspectedRouting/Program.cs +++ b/AspectedRouting/Program.cs @@ -12,7 +12,7 @@ using AspectedRouting.Tests; namespace AspectedRouting { - static class Program + public static class Program { public static List<(AspectMetadata aspect, AspectTestSuite tests)> ParseAspects( this IEnumerable jsonFileNames, List testFileNames, Context context) @@ -104,7 +104,6 @@ namespace AspectedRouting private static void Repl(Context c, Dictionary profiles) { - var profile = profiles["bicycle"]; var behaviour = profile.Behaviours.Keys.First(); do @@ -126,7 +125,7 @@ namespace AspectedRouting { return; } - + if (read.Equals("clear")) { for (int i = 0; i < 80; i++) @@ -150,9 +149,9 @@ namespace AspectedRouting continue; } - beh = beh.Substring(beh.IndexOf(".")+1); + beh = beh.Substring(beh.IndexOf(".") + 1); } - + if (profile.Behaviours.ContainsKey(beh)) { behaviour = beh; @@ -225,17 +224,27 @@ namespace AspectedRouting Console.WriteLine("\n\n\n------------------------"); } - public static void Main(string[] args) + static void Main(string[] args) { - if (args.Length < 2) + var errMessage = MainWithError(args); + if (errMessage != null) { - Console.WriteLine("Usage: "); - return; + Console.WriteLine(errMessage); + } + } + public static string MainWithError(string[] args){ + if (args.Length < 2) + { + return "Usage: "; } var inputDir = args[0]; var outputDir = args[1]; + if (!Directory.Exists(outputDir)) + { + Directory.CreateDirectory(outputDir); + } MdPrinter.GenerateHelpText(outputDir + "helpText.md"); @@ -294,8 +303,7 @@ namespace AspectedRouting if (!testsOk) { - Console.WriteLine("Some tests failed, quitting now without generating output"); - return; + return "Some tests failed, quitting now without generating output"; } foreach (var (profile, profileTests) in profiles) @@ -318,7 +326,13 @@ namespace AspectedRouting aspectTests, profileTests.Where(testsSuite => testsSuite.BehaviourName == behaviourName) ).ToLua(); - File.WriteAllText($"{outputDir}/itinero2/{profile.Name}.{behaviourName}.lua", lua2behaviour); + if(!Directory.Exists($"{outputDir}/itinero2/")) + { + Directory.CreateDirectory($"{outputDir}/itinero2/"); + } + File.WriteAllText( + $"{outputDir}/itinero2/{profile.Name}.{behaviourName}.lua", + lua2behaviour); } } @@ -336,6 +350,7 @@ namespace AspectedRouting { Console.WriteLine("Not starting REPL as --no-repl is specified"); } + return null; } } -} +} \ No newline at end of file diff --git a/Profiles/bicycle/aspects/bicycle.network_by_operator.json b/Profiles/bicycle/aspects/bicycle.network_by_operator.json deleted file mode 100644 index 327717c..0000000 --- a/Profiles/bicycle/aspects/bicycle.network_by_operator.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "bicycle.network_by_operator", - "description": "The 'bicycle.network_score' returns true if the way is part of a cycling network of a certain (group of) operators", - "$memberOf": { - "$mustMatch": { - "type": "route", - "route": "bicycle", - "operator": { - "$containedIn": "#networkOperator" - }, - "#": { - "note": "This block is commented out. A lot of networks we want to perform route planning on, are still proposed", - "state": { - "$not": "proposed" - } - } - } - } -} - diff --git a/Profiles/bicycle/aspects/bicycle.network_is_bicycle_network.json b/Profiles/bicycle/aspects/bicycle.network_is_bicycle_network.json deleted file mode 100644 index 1e7b3e2..0000000 --- a/Profiles/bicycle/aspects/bicycle.network_is_bicycle_network.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "bicycle.network_is_bicycle_network", - "description": "The 'bicycle.network_score' returns true if the way is part of a cycling network", - "$memberOf": { - "$mustMatch": { - "type": "route", - "route": "bicycle", - "state": {"$notEq": "proposed"} - } - } -} - diff --git a/Profiles/bicycle/aspects/bicycle.network_is_cyclehighway.json b/Profiles/bicycle/aspects/bicycle.network_is_cyclehighway.json deleted file mode 100644 index a2fff51..0000000 --- a/Profiles/bicycle/aspects/bicycle.network_is_cyclehighway.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "bicycle.network_is_cyclehighway", - "description": "Returns true if the highway is part of a [cycle highway](https://wiki.openstreetmap.org/wiki/Tag:cycle_network%3Dcycle_highway)", - "$memberOf": { - "$mustMatch": { - "type": "route", - "route": "bicycle", - "state": {"$not": "proposed"}, - "cycle_network": "cycle_highway" - } - } -} - diff --git a/Profiles/bicycle/aspects/speedPedelec.access_be.json b/Profiles/bicycle/aspects/speedPedelec.access_be.json deleted file mode 100644 index 56facd3..0000000 --- a/Profiles/bicycle/aspects/speedPedelec.access_be.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name":"speedPedelec.access_be", - "description": "Describes where a speedpedelec (moped_p) can and can not go. This is quite different from a normal bike", - "$default":"no", - "value":{ - "$firstMatchOf":["access","speed_pedelec","designation"], - "mapping":{ - "access":{ - "no":"no" - }, - "speed_pedelec":{ - "no":"no", - "yes":"yes", - "designated":"designated" - }, - "designation":{ - "towpath":"no" - } - } - } - } diff --git a/Profiles/bicycle/bicycle.json b/Profiles/bicycle/bicycle.json deleted file mode 100644 index 729fb6e..0000000 --- a/Profiles/bicycle/bicycle.json +++ /dev/null @@ -1,173 +0,0 @@ -{ - "name": "bicycle", - "description": "Profile for a normal bicycle", - "vehicletypes": [ - "vehicle", - "bicycle" - ], - "metadata": [ - "name", - "bridge", - "tunnel", - "colour", - "cycle_network_colour", - "cycle_network_ref", - "ref", - "status", - "network" - ], - "access": "$bicycle.legal_access", - "oneway": "$bicycle.oneway", - "speed": { - "$max": [ - "$ferry_speed", - { - "$min": [ - "$legal_maxspeed_be", - "#maxspeed", - { - "$multiply": [ - "#defaultSpeed", - "$bicycle.speed_factor" - ] - } - ] - } - ] - }, - "priority": { - "#comfort": "$bicycle.comfort", - "#safety": "$bicycle.safety", - "#operatorNetworkScore": "$bicycle.network_by_operator", - "#cycleHighwayNetworkScore": "$bicycle.network_is_cyclehighway", - "#nodeNetworkScore": "$bicycle.network_is_nodenetwork", - "#bicycleNetworkScore": "$bicycle.network_is_bicycle_network", - "#timeNeeded": "$speed", - "#distance": "$distance", - "#trespassingPenalty": "$clean_permission_score", - "#leastSafetyPenalty": { - "$multiply": [ - "$speed", - { - "$atleast": "#leastSafetyRequired", - "f": "$bicycle.safety", - "then": 0, - "else": -1 - } - ] - } - }, - "defaults": { - "#defaultSpeed": 15, - "#maxspeed": 30, - "#timeNeeded": 0, - "#distance": 0, - "#comfort": 0, - "#safety": 0, - "#operatorNetworkScore": 0, - "#networkOperator": [], - "#cycleHighwayNetworkScore": 0, - "#nodeNetworkScore": 0, - "#bicycleNetworkScore": 0, - "#trespassingPenalty": 15, - "#": "This is not a priority weight, but rather a kind of access restriction. If 'leastafety' is not met, a huge penalty is applied, namely #leastSafetyPenalty. Note: 0.1 is the safety level of a primary without cycle highway", - "#leastSafetyRequired": 0.11, - "#leastSafetyPenalty": 0 - }, - "behaviours": { - "fastest": { - "description": "The fastest route to your destination", - "#timeNeeded": 1, - "#leastSafetyPenalty": 2 - }, - "shortest": { - "description": "The shortest route, independent of of speed", - "#distance": 1, - "#leastSafetyPenalty": 2 - }, - "safety": { - "description": "A defensive route shying away from big roads with lots of cars", - "#safety": 1 - }, - "comfort": { - "description": "A comfortable route preferring well-paved roads, smaller roads and a bit of scenery at the cost of speed", - "#comfort": 1, - "#leastSafetyPenalty": 2 - }, - "comfort_safety": { - "description": "A route which aims to be both safe and comfortable at the cost of speed", - "#comfort": 1, - "#safety": 1 - }, - "electrical.fastest": { - "description": "A profile for a bike with an electrical motor where the engine doesn't go faster then 25km/h (thus NOT the speed-pedelec). This is a variation of the normal fastest, but with a faster default speed. As the maxspeed is 30, it'll resemble shortest a bit more on 'normal' streets and will penalize slower roads more", - "#defaultSpeed": 23, - "#maxspeed": 30, - "#timeNeeded": 1, - "#leastSafetyPenalty": 2 - }, - "networks": { - "description": "A recreative route following any existing cycling network. Might make a few detours", - "#bicycleNetworkScore": 3, - "#safety": 1 - }, - "brussels": { - "description": "A route preferring the cycling network by operator 'Brussels Mobility'", - "#operatorNetworkScore": 5, - "#networkOperator": [ - "Brussels Mobility" - ], - "#comfort": 1, - "#safety": 1 - }, - "genk": { - "description": "A route preferring the cycling network by operator 'Stad Genk'", - "#operatorNetworkScore": 50, - "#networkOperator": [ - "Stad Genk" - ], - "#safety": 0.1 - }, - "cycle_highway": { - "description": "A route preferring the 'cycle-highways'. On non-cycleways, fastest is used (with a very low factor) in order to make sure the behaviour there is defined ", - "#cycleHighwayNetworkScore": 20, - "#timeNeeded": 0.1, - "#leastSafetyPenalty": 2 - }, - "node_network": { - "description": "A route following the recreational node network. Might make detours", - "#nodeNetworkScore": 10, - "#safety": 1 - }, - "commute": { - "description": "A route for a daily commuter, prefers the 'cycle-highways' or the cycling network by operator 'Brussels Mobility', with a pinch of safety and comfort", - "#operatorNetworkScore": 3, - "#networkOperator": [ - "Brussels Mobility" - ], - "#cycleHighwayNetworkScore": 3, - "#timeNeeded": 1, - "#comfort": 2, - "#safety": 3 - }, - "b2w": { - "description": "[Custom][Private] Route specifically for Bike2Work. Same as commute at this moment. A route preferring the 'cycle-highways' or the cycling network by operator 'Brussels Mobility'", - "#operatorNetworkScore": 3, - "#networkOperator": [ - "Brussels Mobility" - ], - "#cycleHighwayNetworkScore": 3, - "#timeNeeded": 1, - "#comfort": 2, - "#safety": 3 - }, - "anyways.network": { - "description": "[Private][Internal use] A route using the Anyways branded network; mainly used in ShortCut/Impact", - "#timeNeeded": 1, - "#operatorNetworkScore": 10, - "#networkOperator": [ - "Anyways" - ] - } - } -} diff --git a/Profiles/bicycle/speedPedelec.json b/Profiles/bicycle/speedPedelec.json deleted file mode 100644 index 71a441b..0000000 --- a/Profiles/bicycle/speedPedelec.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name":"speedPedelec", - "description":"A vehicle specifically for speed pedelec (aka Moped P) with Belgian legislation in mind. A speed pedelec is a kind of electrical bike with a maxspeed of 45km/h. Due to the high speed, this is considered a kind of moped or motorcycle for belgian law. Sources for more information are [speedpedelecVlaanderen.be](https://speedpedelecvlaanderen.be/infrastructuur-en-regelgeving/wegcode/relevante-verkeersborden/), [Fietsersbond](https://www.fietsersbond.be/speedpedelec)", - "defaults":{ - "#defaultSpeed": 25, - "#maxspeed":45, - "#distance":0 - }, - "vehicletypes":["vehicle","motor_vehicle","moped_p"], - "metadata": [ - "name", - "bridge", - "tunnel", - "colour", - "cycle_network_colour", - "ref", - "status", - "network" - ], - "behaviours":{ - "shortest":{ - "description":"The shortest path", - "#distance":1 - } - - }, - "speed":{ - "$min": - [ - "#maxspeed", - "$legal_maxspeed_be", - { - "$multiply": [ - "#defaultSpeed", - "$bicycle.speed_factor" - ] - } - ] - }, - "access":"$speedPedelec.access_be", - "oneway":"$bicycle.oneway", - "priority":{ - "#distance": 1 - } - -} diff --git a/Profiles/bicycle/tests/bicycle.brussels.behaviour_test.csv b/Profiles/bicycle/tests/bicycle.brussels.behaviour_test.csv deleted file mode 100644 index e9e5908..0000000 --- a/Profiles/bicycle/tests/bicycle.brussels.behaviour_test.csv +++ /dev/null @@ -1,5 +0,0 @@ -access,oneway,speed,priority,highway,_relation:bicycle.network_by_operator -no,both,0,0,, -yes,both,15,1.9,residential, -yes,both,15,6.9,residential,yes -dismount,both,2.25,0.1995,footway, diff --git a/Profiles/bicycle/tests/bicycle.commute.behaviour_test.csv b/Profiles/bicycle/tests/bicycle.commute.behaviour_test.csv deleted file mode 100644 index 976bcd6..0000000 --- a/Profiles/bicycle/tests/bicycle.commute.behaviour_test.csv +++ /dev/null @@ -1,6 +0,0 @@ -access,oneway,speed,priority,highway,_relation:bicycle.network_by_operator,_relation:bicycle.network_is_cyclehighway -no,,,,,, -yes,both,15,19.7,residential,, -yes,both,15,22.7,residential,yes, -yes,both,15,22.7,residential,,yes -yes,both,15,25.7,residential,yes,yes diff --git a/Profiles/bicycle/tests/bicycle.commute_networks.behaviour_test.csv b/Profiles/bicycle/tests/bicycle.commute_networks.behaviour_test.csv deleted file mode 100644 index 5b071e5..0000000 --- a/Profiles/bicycle/tests/bicycle.commute_networks.behaviour_test.csv +++ /dev/null @@ -1,4 +0,0 @@ -access,oneway,speed,priority,highway,_relation:bicycle.network_score -no,,,,, -designated,both,15,2,cycleway, -designated,both,15,22,cycleway,yes diff --git a/Profiles/bicycle/tests/bicycle.cycle_networks.behaviour_test.csv b/Profiles/bicycle/tests/bicycle.cycle_networks.behaviour_test.csv deleted file mode 100644 index 0af5274..0000000 --- a/Profiles/bicycle/tests/bicycle.cycle_networks.behaviour_test.csv +++ /dev/null @@ -1,6 +0,0 @@ -access,oneway,speed,priority,highway,_relation:bicycle.is_cycle_highway -no,,,,, -designated,both,15,1.5,cycleway, -designated,both,15,22,cycleway,yes -yes,both,15,1.5,tertiary, -,,, ,, diff --git a/Profiles/bicycle/tests/bicycle.genk.behaviour_test.csv b/Profiles/bicycle/tests/bicycle.genk.behaviour_test.csv deleted file mode 100644 index 0335f5a..0000000 --- a/Profiles/bicycle/tests/bicycle.genk.behaviour_test.csv +++ /dev/null @@ -1,9 +0,0 @@ -access,oneway,speed,priority,highway,_relation:bicycle.network_by_operator -no,both,0,0,, -yes,both,15,0.09,residential, -yes,both,15,50.09,residential,yes -dismount,both,2.25,0.019,footway, -yes,both,15,50.09,residential,yes -designated,both,15,50.15,cycleway,yes -yes,both,15,0.09,residential,no -designated,both,15,0.15,cycleway,no diff --git a/Profiles/pedestrian/aspects/pedestrian.slow_road_preference.json b/Profiles/pedestrian/aspects/pedestrian.slow_road_preference.json deleted file mode 100644 index cccdefd..0000000 --- a/Profiles/pedestrian/aspects/pedestrian.slow_road_preference.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "pedestrian.slow_road_preference", - "description": "Gives a value between 0 and 2, indicating how lovely a path or track is to walk over. It'll prefer roads with less car-pressure", - "unit": "0: absolutely horrible to walk, 2: absolutely lovely", - "$default": 1, - "value": { - "$multiply": [ - { - "highway": { - "pedestrian": 2, - "living_street": 1.5, - "footway": 1.8, - "path": 1.2 - } - }, - { - "access": { - "destination": 1.5, - "no": 1.5 - } - } - ] - } -} diff --git a/Profiles/rollerskate/aspects/rollerskate.can_access.json b/Profiles/rollerskate/aspects/rollerskate.can_access.json deleted file mode 100644 index 9c9b683..0000000 --- a/Profiles/rollerskate/aspects/rollerskate.can_access.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "rollerskate.can_access", - "description": "Determines if it is possible to skate (or at least pass) over a certain way", - "$default": "no", - "value": { - "highway": { - "residential": "yes", - "service": "yes", - "tertiary": "yes", - "tertiary_link": "yes", - "secondary": "yes", - "secondary_link": "yes", - "cycleway": "yes", - "footway": "yes", - "unclassified": "yes", - "living_street":"yes" - } - } -} diff --git a/Profiles/rollerskate/aspects/rollerskate.comfort.json b/Profiles/rollerskate/aspects/rollerskate.comfort.json deleted file mode 100644 index 498a66b..0000000 --- a/Profiles/rollerskate/aspects/rollerskate.comfort.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "rollerskate.comfort", - "description": "How smooth is this road, on a factor 0 (horrible) to 1 (excellent)?", - "$default": 0.3, - "value": { - "$firstMatchOf": [ - "highway", - "smoothness", - "surface", - "sidewalk:surface" - ], - "value": { - "highway": { - "primary": 0.2, - "secondary": 0.2 - }, - "smoothness": { - "excellent": 1, - "very_good": 0.95, - "good": 0.75, - "intermediate": 0.5, - "bad": 0.1 - }, - "surface": { - "asphalt": 0.7, - "concrete": 0.7, - "paving_stones": 0.65, - "sett": 0.01 - }, - "sidewalk:surface": { - "asphalt": 0.7, - "concrete": 0.7, - "paving_stones": 0.65, - "sett": 0.01 - } - } - } -} \ No newline at end of file diff --git a/Profiles/rollerskate/rollerskate.json b/Profiles/rollerskate/rollerskate.json deleted file mode 100644 index b04c543..0000000 --- a/Profiles/rollerskate/rollerskate.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "rollerskate", - "description": "Tries to find a suitable way to rollerskate somewhere. Uses mostly smoothness and surface to determine where to go", - "access": "$rollerskate.can_access", - "oneway": "both", - "speed": { - "$multiply": [ - "#defaultSpeed", - "$rollerskate.comfort" - ] - }, - "priority": { - "#speedFactor": "$speed" - }, - "behaviours": { - "fastest": { - "description": "The fastest (and thus smoothest) route", - "#speedFactor": 1 - } - }, - "defaults": { - "#defaultSpeed": 20, - "#speedFactor": 0 - }, - "vehicletypes": [ - "vehicle", - "rollerskate" - ], - "metadata": [ - "name" - ] -} \ No newline at end of file