|
MATSIM
|

Public Member Functions | |
| void | handleActivity (Activity activity) |
| void | handleLeg (Leg leg) |
| void | agentStuck (final double time) |
| void | addMoney (final double amount) |
| void | addScore (final double amount) |
| void | finish () |
| double | getScore () |
| void | handleEvent (Event event) |
| default void | handleTrip (TripStructureUtils.Trip trip) |
| default void | explainScore (StringBuilder out) |
Public Attributes | |
| String | SCORE_DELIMITER = ";" |
| String | SCORE_EXPLANATION_ATTR = "scoreExplanation" |
A scoring function calculates the score for one plan of an agent. The score usually depends on how much time an agent is traveling and how much time an agent spends at an activity. Thus the scoring function gets informed when activities start and end as well as when legs start and end.
Note that one ScoringFunction calculates the score for exactly one agent. Thus every agents must have its own instance of a scoring function!
See tutorial.programming.example16customscoring.RunCustomScoringExample for an example.
Definition at line 42 of file ScoringFunction.java.
| void org.matsim.core.scoring.ScoringFunction.handleActivity | ( | Activity | activity | ) |
Tells the scoring function about an Activity. The Activity which the agent is in when the simulation starts will have a startTime of Time.getUndefinedTime(). The Activity which the agent is in when the simulation ends will have an endTime of Time.getUndefinedTime(). It is up to the implementation what to make of this, especially to "wrap" it "around".
| activity |
Implemented in org.matsim.deprecated.scoring.ScoringFunctionAccumulator, org.matsim.core.scoring.SumScoringFunction, org.matsim.core.scoring.functions.OnlyTravelTimeDependentScoringFunction, and org.matsim.deprecated.scoring.ScoringFunctionAdapter.
| void org.matsim.core.scoring.ScoringFunction.handleLeg | ( | Leg | leg | ) |
Tells the scoring function about a Leg. Will contain complete route information for network routes (as you would expect in a Plan), but only a GenericRoute for everything else, especially transit.
Implemented in org.matsim.deprecated.scoring.ScoringFunctionAccumulator, org.matsim.core.scoring.SumScoringFunction, org.matsim.deprecated.scoring.ScoringFunctionAdapter, and org.matsim.core.scoring.functions.OnlyTravelTimeDependentScoringFunction.
| void org.matsim.core.scoring.ScoringFunction.agentStuck | ( | final double | time | ) |
Tells the scoring function that the agent got stuck in the simulation and is removed from the simulation. This should usually lead to a high penalty in the score, as the agent was not able to perform its plan as wanted. An agent can get stuck while performing an activity or while driving.
| time | The time at which the agent got stuck and was removed from the simulation. |
Implemented in org.matsim.core.scoring.SumScoringFunction, org.matsim.deprecated.scoring.ScoringFunctionAccumulator, and org.matsim.core.scoring.functions.OnlyTravelTimeDependentScoringFunction.
| void org.matsim.core.scoring.ScoringFunction.addMoney | ( | final double | amount | ) |
Adds the specified amount of utility to the agent's score. This is mostly used for handling PersonMoneyEvents, allowing other parts of the code to influence an agent's score.
| amount | amount to be added to the agent's score |
Implemented in org.matsim.core.scoring.SumScoringFunction, org.matsim.deprecated.scoring.ScoringFunctionAccumulator, and org.matsim.core.scoring.functions.OnlyTravelTimeDependentScoringFunction.
| void org.matsim.core.scoring.ScoringFunction.addScore | ( | final double | amount | ) |
Adds the specified amount of utility to the agent's score. This is mostly used for handling PersonScoreEvents, allowing other parts of the code to influence an agent's score.
| amount | amount to be added to the agent's score |
Implemented in org.matsim.core.scoring.SumScoringFunction, org.matsim.deprecated.scoring.ScoringFunctionAccumulator, and org.matsim.core.scoring.functions.OnlyTravelTimeDependentScoringFunction.
| void org.matsim.core.scoring.ScoringFunction.finish | ( | ) |
Tells the scoring function that no more information will be given to it and that the final score should be calculated. But the score must not be written to the plan!
Implemented in org.matsim.deprecated.scoring.ScoringFunctionAccumulator, org.matsim.core.scoring.SumScoringFunction, and org.matsim.core.scoring.functions.OnlyTravelTimeDependentScoringFunction.
| double org.matsim.core.scoring.ScoringFunction.getScore | ( | ) |
Returns the score for this plan.
Implemented in org.matsim.deprecated.scoring.ScoringFunctionAccumulator, org.matsim.core.scoring.SumScoringFunction, and org.matsim.core.scoring.functions.OnlyTravelTimeDependentScoringFunction.
Referenced by org.matsim.core.scoring.EventsToScore.getAgentScore().
| void org.matsim.core.scoring.ScoringFunction.handleEvent | ( | Event | event | ) |
| default void org.matsim.core.scoring.ScoringFunction.handleTrip | ( | TripStructureUtils.Trip | trip | ) |
Definition at line 107 of file ScoringFunction.java.
| default void org.matsim.core.scoring.ScoringFunction.explainScore | ( | StringBuilder | out | ) |
Write detailed score explanation into the output
. Multiple value should be separated with SCORE_DELIMITER.
Implemented in org.matsim.core.scoring.SumScoringFunction.
Definition at line 115 of file ScoringFunction.java.
| String org.matsim.core.scoring.ScoringFunction.SCORE_DELIMITER = ";" |
Delimiter used to separate scores in explanation string.
Definition at line 121 of file ScoringFunction.java.
Referenced by org.matsim.core.scoring.functions.CharyparNagelMoneyScoring.explainScore(), org.matsim.core.scoring.functions.CharyparNagelActivityScoring.explainScore(), org.matsim.core.scoring.functions.CharyparNagelLegScoring.explainScore(), and org.matsim.core.scoring.SumScoringFunction.explainScore().
| String org.matsim.core.scoring.ScoringFunction.SCORE_EXPLANATION_ATTR = "scoreExplanation" |
The attribute that will be used for the score explanation.
Definition at line 125 of file ScoringFunction.java.
1.8.13