001/* *********************************************************************** * 002 * project: org.matsim.* 003 * LegStartedIdentifierFactory.java 004 * * 005 * *********************************************************************** * 006 * * 007 * copyright : (C) 2012 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; 022 023import org.matsim.withinday.mobsim.MobsimDataProvider; 024import org.matsim.withinday.replanning.identifiers.interfaces.DuringLegAgentSelector; 025import org.matsim.withinday.replanning.identifiers.interfaces.DuringLegIdentifierFactory; 026import org.matsim.withinday.replanning.identifiers.tools.LinkReplanningMap; 027 028public class LegStartedIdentifierFactory extends DuringLegIdentifierFactory { 029 030 private final LinkReplanningMap linkReplanningMap; 031 private final MobsimDataProvider mobsimDataProvider; 032 033 public LegStartedIdentifierFactory(LinkReplanningMap linkReplanningMap, MobsimDataProvider mobsimDataProvider) { 034 this.linkReplanningMap = linkReplanningMap; 035 this.mobsimDataProvider = mobsimDataProvider; 036 } 037 038 @Override 039 public DuringLegAgentSelector createIdentifier() { 040 DuringLegAgentSelector identifier = new LegStartedIdentifier(this.linkReplanningMap, this.mobsimDataProvider); 041 this.addAgentFiltersToIdentifier(identifier); 042 identifier.setAgentSelectorFactory(this); 043 return identifier; 044 } 045 046}