forked from matsim-org/matsim-libs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IMC Trip Score Estimator (matsim-org#3642)
* add interface for trip score estimates * fix injection * fix test * make strategy names final
Showing
7 changed files
with
109 additions
and
31 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
18 changes: 18 additions & 0 deletions
18
...formed-mode-choice/src/main/java/org/matsim/modechoice/estimators/TripScoreEstimator.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,18 @@ | ||
package org.matsim.modechoice.estimators; | ||
|
||
import org.matsim.core.router.TripStructureUtils; | ||
import org.matsim.modechoice.EstimatorContext; | ||
|
||
/** | ||
* This class can be used to estimate additional scores for a trip. | ||
* These score are added to the existing estimates and might be independent of the mode. | ||
*/ | ||
public interface TripScoreEstimator { | ||
|
||
/** | ||
* Compute a score estimate for a trip. | ||
*/ | ||
double estimate(EstimatorContext context, String mainMode, TripStructureUtils.Trip trip); | ||
|
||
|
||
} |
23 changes: 23 additions & 0 deletions
23
...med-mode-choice/src/main/java/org/matsim/modechoice/pruning/PlanScoreThresholdPruner.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,23 @@ | ||
package org.matsim.modechoice.pruning; | ||
|
||
import org.matsim.modechoice.PlanModel; | ||
|
||
/** | ||
* Removes plans by a fixed utility threshold. | ||
*/ | ||
public class PlanScoreThresholdPruner implements CandidatePruner { | ||
|
||
private final double threshold; | ||
|
||
/** | ||
* Threshold to be applied on the best known plan estimate. Candidates with a larger difference to the best, than this threshold are discarded. | ||
*/ | ||
public PlanScoreThresholdPruner(double threshold) { | ||
this.threshold = threshold; | ||
} | ||
|
||
@Override | ||
public double planThreshold(PlanModel planModel) { | ||
return threshold; | ||
} | ||
} |
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