-
Notifications
You must be signed in to change notification settings - Fork 457
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prepare capacity models, use the new predictor interface
- Loading branch information
Showing
11 changed files
with
150 additions
and
61 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
14 changes: 8 additions & 6 deletions
14
...application/src/main/java/org/matsim/application/prepare/network/params/NetworkModel.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 |
---|---|---|
@@ -1,22 +1,24 @@ | ||
package org.matsim.application.prepare.network.params; | ||
|
||
import org.matsim.application.prepare.Predictor; | ||
|
||
/** | ||
* A model for estimating network parameters. | ||
*/ | ||
public interface NetworkModel { | ||
|
||
/** | ||
* Flow Capacity (per lane) | ||
* Flow Capacity (per lane). | ||
*/ | ||
default FeatureRegressor capacity(String junctionType, String highwayType) { | ||
return null; | ||
default Predictor capacity(String junctionType, String highwayType) { | ||
throw new UnsupportedOperationException("Capacity model not implemented for class: " + getClass().getName()); | ||
} | ||
|
||
/** | ||
* Speed factor (relative to free flow speed). | ||
* Speed factor (relative to allowed speed). | ||
*/ | ||
default FeatureRegressor speedFactor(String junctionType, String highwayType) { | ||
return null; | ||
default Predictor speedFactor(String junctionType, String highwayType) { | ||
throw new UnsupportedOperationException("Speed factor model not implemented for class: " + getClass().getName()); | ||
} | ||
|
||
} |
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
15 changes: 15 additions & 0 deletions
15
.../src/main/java/org/matsim/application/prepare/network/params/hbs/HBSMotorwayCapacity.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,15 @@ | ||
package org.matsim.application.prepare.network.params.hbs; | ||
|
||
import it.unimi.dsi.fastutil.objects.Object2DoubleMap; | ||
import it.unimi.dsi.fastutil.objects.Object2ObjectMap; | ||
import org.matsim.application.prepare.Predictor; | ||
|
||
/** | ||
* Capacity for motorways. | ||
*/ | ||
public class HBSMotorwayCapacity implements Predictor { | ||
@Override | ||
public double predict(Object2DoubleMap<String> features, Object2ObjectMap<String, String> categories) { | ||
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
11 changes: 5 additions & 6 deletions
11
...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 |
---|---|---|
@@ -1,16 +1,15 @@ | ||
package org.matsim.application.prepare.network.params.hbs; | ||
|
||
import it.unimi.dsi.fastutil.objects.Object2DoubleMap; | ||
import org.matsim.application.prepare.network.params.FeatureRegressor; | ||
import it.unimi.dsi.fastutil.objects.Object2ObjectMap; | ||
import org.matsim.application.prepare.Predictor; | ||
|
||
/** | ||
* See {@link HBSNetworkParams}. | ||
* Capacity for general roads, that are not motorways or residential roads. | ||
*/ | ||
class HBSRoadCapacity implements FeatureRegressor { | ||
public class HBSRoadCapacity implements Predictor { | ||
@Override | ||
public double predict(Object2DoubleMap<String> ft) { | ||
|
||
public double predict(Object2DoubleMap<String> features, Object2ObjectMap<String, String> categories) { | ||
return 0; | ||
|
||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
.../src/main/java/org/matsim/application/prepare/network/params/hbs/HBSSideRoadCapacity.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,39 @@ | ||
package org.matsim.application.prepare.network.params.hbs; | ||
|
||
import it.unimi.dsi.fastutil.objects.Object2DoubleMap; | ||
import it.unimi.dsi.fastutil.objects.Object2ObjectMap; | ||
import org.matsim.application.prepare.Predictor; | ||
|
||
/** | ||
* Road capacity for residential roads or other of similar or lower category. | ||
*/ | ||
public class HBSSideRoadCapacity implements Predictor { | ||
@Override | ||
public double predict(Object2DoubleMap<String> features, Object2ObjectMap<String, String> categories) { | ||
|
||
return 0; | ||
|
||
|
||
} | ||
|
||
/** | ||
* Capacity of a side road merging into a main road. | ||
*/ | ||
public double capacityMerging(Object2DoubleMap<String> features) { | ||
|
||
// See HBS page 5-20, eq. S5-12 table S5-5 | ||
|
||
// mean Folgezeitlücken of the different combinations | ||
double tf = 3.5; | ||
|
||
// mean Grenzzeitlücke | ||
double tg = 6.36; | ||
|
||
// traffic volume on the main road | ||
// here an assumption needs to be made, normally the capacity of the side roads would not be constant | ||
double qP = 400; | ||
|
||
return Math.exp( (-qP/3600) * (tg - tf/2)) * 3600/tf; | ||
} | ||
|
||
} |
14 changes: 0 additions & 14 deletions
14
.../src/main/java/org/matsim/application/prepare/network/params/hbs/HSBMotorwayCapacity.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.