MATSIM
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.example10PluggablePlanStrategyFromFile;
21 
22 import org.apache.log4j.Logger;
23 import org.matsim.api.core.v01.population.HasPlansAndId;
26 import org.matsim.core.replanning.selectors.PlanSelector;
27 
31 class MyPlanSelector implements PlanSelector<Plan, Person>
32 {
33  private static final Logger log = Logger.getLogger(MyPlanSelector.class);
34 
35  @Override
36  public Plan selectPlan(HasPlansAndId<Plan, Person> person) {
37  log.error("calling selectPlan. Just selecting the first plan as an example.") ;
38  return person.getPlans().get(0);
39  }
40 
41 }