MATSIM
PositionEventsWriter.java
Go to the documentation of this file.
1 package org.matsim.vis.snapshotwriters;
2 
4 
5 class PositionEventsWriter implements SnapshotWriter{
6  private final EventsManager eventsManager;
7  private double now;
8  PositionEventsWriter( EventsManager eventsManager ){
9  this.eventsManager = eventsManager;
10  }
11  @Override public void beginSnapshot( double time ){
12  now = time;
13  }
14  @Override public void endSnapshot(){
15  //throw new RuntimeException( "not implemented" ); dont do anything
16  }
17  @Override public void addAgent( AgentSnapshotInfo position ){
18  eventsManager.processEvent( new PositionEvent( now, position ) );
19  }
20  @Override public void finish(){
21  //throw new RuntimeException( "not implemented" ); dont do anything
22  }
23 }