MATSIM
ReplanningEvent.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.*
3  * ReplanningEventImpl.java
4  * *
5  * *********************************************************************** *
6  * *
7  * copyright : (C) 2012 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.events;
22 
23 import java.util.Map;
24 
25 import org.matsim.api.core.v01.Id;
28 
32 public class ReplanningEvent extends Event {
33 
34  public static final String EVENT_TYPE = "replanning";
35  public static final String ATTRIBUTE_REPLANNERTYPE = "replanner";
36 
37  public static final String ATTRIBUTE_PERSON = "person";
38 
39  private final Id<Person> personId;
40 
41  private final String replannerType;
42 
43  public ReplanningEvent(final double time, final Id<Person> personId, final String replannerType) {
44  super(time);
45  this.personId = personId;
46  this.replannerType = replannerType;
47  }
48 
49  @Override
50  public Map<String, String> getAttributes() {
51  Map<String, String> attr = super.getAttributes();
52 
53  attr.put(ATTRIBUTE_PERSON, this.personId.toString());
54  attr.put(ATTRIBUTE_REPLANNERTYPE, this.replannerType);
55 
56  return attr;
57  }
58 
59  public String getReplannerType() {
60  return this.replannerType;
61  }
62 
63  @Override
64  public String getEventType() {
65  return EVENT_TYPE;
66  }
67 
69  return this.personId;
70  }
71 
72 }
ReplanningEvent(final double time, final Id< Person > personId, final String replannerType)