MATSIM
AgentWaitingForPtEvent.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.*
3  * *
4  * *********************************************************************** *
5  * *
6  * copyright : (C) 2012 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 org.matsim.core.api.experimental.events;
21 
22 import java.util.Map;
23 
24 import org.matsim.api.core.v01.Id;
29 
35 public final class AgentWaitingForPtEvent extends Event implements HasPersonId {
36 
37  public static final String EVENT_TYPE = "waitingForPt";
38  public static final String ATTRIBUTE_AGENT = "agent";
39  public static final String ATTRIBUTE_WAITSTOP = "atStop";
40  public static final String ATTRIBUTE_DESTINATIONSTOP = "destinationStop";
41  public final Id<Person> agentId;
44 
45  public AgentWaitingForPtEvent(final double now, final Id<Person> agentId,
46  final Id<TransitStopFacility> waitingAtStopId, final Id<TransitStopFacility> destinationStopId) {
47  super(now);
48  this.agentId = agentId;
49  this.waitingAtStopId = waitingAtStopId;
50  this.destinationStopId = destinationStopId;
51  }
52 
54  return this.agentId;
55  }
56 
58  return this.waitingAtStopId;
59  }
60 
62  return this.destinationStopId;
63  }
64 
65  @Override
66  public String getEventType() {
67  return EVENT_TYPE;
68  }
69 
70  @Override
71  public Map<String, String> getAttributes() {
72  Map<String, String> attr = super.getAttributes();
73 
74  attr.put(ATTRIBUTE_AGENT, this.agentId.toString());
75  attr.put(ATTRIBUTE_WAITSTOP, this.waitingAtStopId.toString());
76  attr.put(ATTRIBUTE_DESTINATIONSTOP, this.destinationStopId.toString());
77 
78  return attr;
79  }
80 }
AgentWaitingForPtEvent(final double now, final Id< Person > agentId, final Id< TransitStopFacility > waitingAtStopId, final Id< TransitStopFacility > destinationStopId)