MATSIM
withinday
replanning
identifiers
ActivityEndIdentifier.java
Go to the documentation of this file.
1
/* *********************************************************************** *
2
* project: org.matsim.*
3
* ActivityEndIdentifier.java
4
* *
5
* *********************************************************************** *
6
* *
7
* copyright : (C) 2011 by the members listed in the COPYING, *
8
* LICENSE and WARRANTY file. *
9
* email : info at matsim dot org *
10
* *
11
* *********************************************************************** *
12
* *
13
* This program is free software; you can redistribute it and/or modify *
14
* it under the terms of the GNU General Public License as published by *
15
* the Free Software Foundation; either version 2 of the License, or *
16
* (at your option) any later version. *
17
* See also COPYING, LICENSE and WARRANTY file *
18
* *
19
* *********************************************************************** */
20
21
package
org.matsim.withinday.replanning.identifiers;
22
23
import
java.util.Set;
24
import
java.util.TreeSet;
25
26
import
org
.
matsim
.
api
.
core
.
v01
.
Id
;
27
import
org
.
matsim
.
api
.
core
.
v01
.
population
.
Person
;
28
import
org
.
matsim
.
core
.
mobsim
.
framework
.
MobsimAgent
;
29
import
org
.
matsim
.
withinday
.
replanning
.
identifiers
.
interfaces
.
DuringActivityAgentSelector
;
30
import
org
.
matsim
.
withinday
.
replanning
.
identifiers
.
tools
.
ActivityReplanningMap
;
31
32
public
class
ActivityEndIdentifier
extends
DuringActivityAgentSelector
{
33
34
protected
ActivityReplanningMap
activityReplanningMap
;
35
36
// use the Factory!
37
/*package*/
ActivityEndIdentifier
(
ActivityReplanningMap
activityReplanningMap) {
38
this.activityReplanningMap =
activityReplanningMap
;
39
}
40
41
@Override
42
public
Set<MobsimAgent>
getAgentsToReplan
(
double
time) {
43
Set<MobsimAgent> agentsToReplan =
new
TreeSet<MobsimAgent>(
new
ById());
44
45
for
(
MobsimAgent
mobsimAgent : this.activityReplanningMap.
getActivityEndingAgents
(time)) {
46
Id<Person>
agentId = mobsimAgent.getId();
47
if
(this.
applyFilters
(agentId, time)) agentsToReplan.add(mobsimAgent);
48
}
49
50
/*
51
* Here was lots of additional code that identified agents which ended their activity, then
52
* performed a leg starting and ending on the same link and then performed an activity with
53
* duration of 0 seconds. Such agents then start the leg after the next activity in the next
54
* time step. As a result, that leg was not replanned. However, Performing this check should
55
* be implemented at another place (i.e. in a replanner or in a module that ensure that each
56
* activity has a duration of at least one second).
57
*
58
* cdobler, aug'13
59
*/
60
61
return
agentsToReplan;
62
}
63
64
}
org.matsim.api.core.v01.Id
Definition:
Id.java:44
org.matsim.withinday.replanning.identifiers.tools
Definition:
ActivityReplanningMap.java:21
org.matsim.core.mobsim.framework
Definition:
AbstractMobsimModule.java:22
org.matsim.withinday.replanning.identifiers.interfaces.DuringActivityAgentSelector
Definition:
DuringActivityAgentSelector.java:23
org.matsim.withinday.replanning.identifiers.ActivityEndIdentifier
Definition:
ActivityEndIdentifier.java:32
org.matsim.api.core.v01.population
Definition:
Activity.java:21
org.matsim.withinday.replanning.identifiers.interfaces
Definition:
AgentFilter.java:21
org
org.matsim.core.mobsim.framework.MobsimAgent
Definition:
MobsimAgent.java:41
org.matsim.core.mobsim
Definition:
DefaultMobsimModule.java:23
org.matsim.api
org.matsim.withinday.replanning.identifiers
Definition:
ActivityEndIdentifier.java:21
org.matsim.withinday.replanning
org.matsim.core
org.matsim.withinday
org.matsim.api.core
org.matsim.withinday.replanning.identifiers.ActivityEndIdentifier.getAgentsToReplan
Set< MobsimAgent > getAgentsToReplan(double time)
Definition:
ActivityEndIdentifier.java:42
org.matsim.withinday.replanning.identifiers.interfaces.AgentSelector.applyFilters
final void applyFilters(Set< Id< Person >> set, double time)
Definition:
AgentSelector.java:58
org.matsim.withinday.replanning.identifiers.tools.ActivityReplanningMap
Definition:
ActivityReplanningMap.java:60
org.matsim.withinday.replanning.identifiers.ActivityEndIdentifier.activityReplanningMap
ActivityReplanningMap activityReplanningMap
Definition:
ActivityEndIdentifier.java:34
org.matsim
org.matsim.withinday.replanning.identifiers.tools.ActivityReplanningMap.getActivityEndingAgents
Collection< MobsimAgent > getActivityEndingAgents(double time)
Definition:
ActivityReplanningMap.java:285
org.matsim.api.core.v01.population.Person
Definition:
Person.java:28
org.matsim.api.core.v01
Definition:
BasicLocation.java:20
Generated by
1.8.13