MATSIM
Main Page
Related Pages
Packages
Classes
Files
File List
tutorial
programming
example11PluggablePlanStrategyInCode
MyPlanSelector.java
Go to the documentation of this file.
1
/* *********************************************************************** *
2
* project: org.matsim.*
3
* MyPlansSelector.java
4
* *
5
* *********************************************************************** *
6
* *
7
* copyright : (C) 2010 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
package
tutorial.programming.example11PluggablePlanStrategyInCode;
21
22
import
org
.apache.log4j.Logger;
23
import
org
.
matsim
.
api
.
core
.
v01
.
events
.
ActivityEndEvent
;
24
import
org
.
matsim
.
api
.
core
.
v01
.
events
.
handler
.
ActivityEndEventHandler
;
25
import
org
.
matsim
.
api
.
core
.
v01
.
population
.HasPlansAndId;
26
import
org
.
matsim
.
api
.
core
.
v01
.
population
.
Person
;
27
import
org
.
matsim
.
api
.
core
.
v01
.
population
.
Plan
;
28
import
org
.
matsim
.
core
.
replanning
.
selectors
.PlanSelector;
29
33
class
MyPlanSelector
implements
PlanSelector<Plan, Person>,
ActivityEndEventHandler
34
{
35
private
static
final
Logger log = Logger.getLogger(MyPlanSelector.class);
36
37
@Override
38
public
Plan
selectPlan(HasPlansAndId<Plan, Person> person) {
39
log.error(
"calling selectPlan: PesonId: "
+ person.getId() +
" Returning first Plan"
) ;
40
//returning first plan available. In real live the selection will be more sophisticated
41
return
person.getPlans().get(0);
42
}
43
44
@Override
45
public
void
handleEvent(
ActivityEndEvent
event) {
46
//log.error("calling handleEvent for an ActivityEndEvent") ;
47
}
48
49
@Override
50
public
void
reset(
int
iteration) {
51
log.error(
"calling reset"
) ;
52
}
53
54
}
org.matsim.core.replanning
Definition:
GenericPlanStrategy.java:19
org.matsim.api.core.v01.population
Definition:
Activity.java:21
org
org.matsim.core.replanning.selectors
Definition:
AbstractPlanSelector.java:19
org.matsim.api
org.matsim.core
org.matsim.api.core
org.matsim.api.core.v01.events.ActivityEndEvent
Definition:
ActivityEndEvent.java:31
org.matsim.api.core.v01.events.handler
Definition:
ActivityEndEventHandler.java:21
org.matsim.api.core.v01.events.handler.ActivityEndEventHandler
Definition:
ActivityEndEventHandler.java:26
org.matsim.api.core.v01.events
Definition:
ActivityEndEvent.java:21
org.matsim
org.matsim.api.core.v01.population.Plan
Definition:
Plan.java:36
org.matsim.api.core.v01.population.Person
Definition:
Person.java:28
org.matsim.api.core.v01
Definition:
BasicLocation.java:20
Generated on Sat Oct 22 2016 11:22:52 for MATSIM by
1.8.8