MATSIM
MyPlanStrategyModule.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.*
3  * *
4  * *********************************************************************** *
5  * *
6  * copyright : (C) 2011 by the members listed in the COPYING, *
7  * LICENSE and WARRANTY file. *
8  * email : info at matsim dot org *
9  * *
10  * *********************************************************************** *
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * See also COPYING, LICENSE and WARRANTY file *
17  * *
18  * *********************************************************************** */
19 
20 package tutorial.programming.example11PluggablePlanStrategyInCode;
21 
22 import org.apache.log4j.Logger;
23 import org.matsim.api.core.v01.Scenario;
31 
32 class MyPlanStrategyModule implements PlanStrategyModule, ActivityEndEventHandler {
33  private static final Logger log = Logger.getLogger(MyPlanStrategyModule.class);
34 
35  Scenario sc;
36  Network net;
37  Population pop;
38 
39  public MyPlanStrategyModule(Scenario scenario) {
40  this.sc = scenario;
41  this.net = this.sc.getNetwork();
42  this.pop = this.sc.getPopulation();
43  }
44 
45  @Override
46  public void finishReplanning() {
47  }
48 
49  @Override
50  public void handlePlan(Plan plan) {
51  log.error("calling handlePlan for person.Id: " + plan.getPerson().getId());
52  }
53 
54  @Override
55  public void prepareReplanning(ReplanningContext replanningContext) {
56  log.error("calling prepareReplanning");
57  }
58 
59  @Override
60  public void handleEvent(ActivityEndEvent event) {
61  //log.error("calling handleEvent for an ActivityEndEvent");
62  }
63 
64  @Override
65  public void reset(int iteration) {
66  log.error("calling reset");
67  }
68 
69 }
final void prepareReplanning(ReplanningContext replanningContextTmp)