-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update matsim, workflows and experiment run class
- Loading branch information
Showing
4 changed files
with
59 additions
and
26 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
24 changes: 24 additions & 0 deletions
24
src/main/java/org/matsim/run/scoring/PseudoRandomTripScoreEstimator.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,24 @@ | ||
package org.matsim.run.scoring; | ||
|
||
import com.google.inject.Inject; | ||
import org.matsim.core.router.TripStructureUtils; | ||
import org.matsim.modechoice.EstimatorContext; | ||
import org.matsim.modechoice.estimators.TripScoreEstimator; | ||
|
||
/** | ||
* Provides the pseudo random score to the estimator. | ||
*/ | ||
public class PseudoRandomTripScoreEstimator implements TripScoreEstimator { | ||
|
||
private final PseudoRandomScorer scorer; | ||
|
||
@Inject | ||
public PseudoRandomTripScoreEstimator(PseudoRandomScorer scorer) { | ||
this.scorer = scorer; | ||
} | ||
|
||
@Override | ||
public double estimate(EstimatorContext context, String mainMode, TripStructureUtils.Trip trip) { | ||
return scorer.scoreTrip(context.person.getId(), mainMode, trip); | ||
} | ||
} |