001/* *********************************************************************** * 002 * project: org.matsim.* 003 * NextTransportModeFilterFactory.java 004 * * 005 * *********************************************************************** * 006 * * 007 * copyright : (C) 2014 by the members listed in the COPYING, * 008 * LICENSE and WARRANTY file. * 009 * email : info at matsim dot org * 010 * * 011 * *********************************************************************** * 012 * * 013 * This program is free software; you can redistribute it and/or modify * 014 * it under the terms of the GNU General Public License as published by * 015 * the Free Software Foundation; either version 2 of the License, or * 016 * (at your option) any later version. * 017 * See also COPYING, LICENSE and WARRANTY file * 018 * * 019 * *********************************************************************** */ 020 021package org.matsim.withinday.replanning.identifiers.filter; 022 023import java.util.Set; 024 025import org.matsim.withinday.mobsim.MobsimDataProvider; 026import org.matsim.withinday.replanning.identifiers.interfaces.AgentFilterFactory; 027 028public class NextTransportModeFilterFactory implements AgentFilterFactory { 029 030 private final Set<String> modes; 031 private final MobsimDataProvider mobsimDataProvider; 032 033 public NextTransportModeFilterFactory(Set<String> modes, MobsimDataProvider mobsimDataProvider) { 034 this.modes = modes; 035 this.mobsimDataProvider = mobsimDataProvider; 036 } 037 038 @Override 039 public NextTransportModeFilter createAgentFilter() { 040 return new NextTransportModeFilter(this.mobsimDataProvider.getAgents(), this.modes); 041 } 042 043}