private void doSnapshot(final double time) { if (time >= skipUntil) { if (!this.snapshotWriters.isEmpty()) { Collection<AgentSnapshotInfo> positions = getVehiclePositions(time); for (SnapshotWriter writer : this.snapshotWriters) { writer.beginSnapshot(time); for (AgentSnapshotInfo position : positions) { writer.addAgent(position); } writer.endSnapshot(); } } } }
private void doSnapshot(final double time, VisMobsim visMobsim) { if (!this.snapshotWriters.isEmpty()) { Collection<AgentSnapshotInfo> positions = new ArrayList<AgentSnapshotInfo>(); for (VisLink link : visMobsim.getVisNetwork().getVisLinks().values()) { link.getVisData().addAgentSnapshotInfo(positions); } // We do not put non-network agents in movies. // Otherwise, we would add snapshots from visMobsim.getNonNetworkAgentSnapshots() here. for (SnapshotWriter writer : this.snapshotWriters) { writer.beginSnapshot(time); for (AgentSnapshotInfo position : positions) { writer.addAgent(position); } writer.endSnapshot(); } } }