-
Notifications
You must be signed in to change notification settings - Fork 453
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding todos for network param improvements
- Loading branch information
Showing
9 changed files
with
130 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...ion/src/main/java/org/matsim/application/prepare/network/params/hbs/HBSNetworkParams.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.matsim.application.prepare.network.params.hbs; | ||
|
||
import org.matsim.application.prepare.network.params.FeatureRegressor; | ||
import org.matsim.application.prepare.network.params.NetworkModel; | ||
|
||
/** | ||
* Capacity params calculated according to | ||
* "Handbuch für die Bemessung von Straßenverkehrsanlagen“ (HBS) | ||
*/ | ||
public class HBSNetworkParams implements NetworkModel { | ||
|
||
@Override | ||
public FeatureRegressor capacity(String junctionType) { | ||
// TODO: should depend on junction type and or road type | ||
return new HBSRoadCapacity(); | ||
} | ||
|
||
@Override | ||
public FeatureRegressor speedFactor(String junctionType) { | ||
throw new UnsupportedOperationException("Not implemented"); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...tion/src/main/java/org/matsim/application/prepare/network/params/hbs/HBSRoadCapacity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.matsim.application.prepare.network.params.hbs; | ||
|
||
import it.unimi.dsi.fastutil.objects.Object2DoubleMap; | ||
import org.matsim.application.prepare.network.params.FeatureRegressor; | ||
|
||
/** | ||
* See {@link HBSNetworkParams}. | ||
*/ | ||
class HBSRoadCapacity implements FeatureRegressor { | ||
@Override | ||
public double predict(Object2DoubleMap<String> ft) { | ||
return 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,5 @@ void apply() throws Exception { | |
); | ||
|
||
assertThat(output.resolve("network-opt.xml")).exists(); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
contribs/sumo/src/test/java/org/matsim/contrib/sumo/SumoNetworkFeatureExtractorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.matsim.contrib.sumo; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
class SumoNetworkFeatureExtractorTest { | ||
|
||
@Test | ||
void curvature() throws Exception { | ||
|
||
String[] coords = {"0,0", "0,100", "0,0"}; | ||
SumoNetworkHandler.Edge edge = new SumoNetworkHandler.Edge("1", "2", "3", "highway", 0, "name", coords); | ||
edge.lanes.add(new SumoNetworkHandler.Lane("1", 0, 200, 50/3.6, null, null)); | ||
|
||
double ku = SumoNetworkFeatureExtractor.calcCurvature(edge); | ||
|
||
//TODO should be around 400 for 200m road | ||
|
||
System.out.println(ku); | ||
|
||
} | ||
} |