001/* 002 * *********************************************************************** * 003 * * project: org.matsim.* 004 * * TravelDisutilityModule.java 005 * * * 006 * * *********************************************************************** * 007 * * * 008 * * copyright : (C) 2015 by the members listed in the COPYING, * 009 * * LICENSE and WARRANTY file. * 010 * * email : info at matsim dot org * 011 * * * 012 * * *********************************************************************** * 013 * * * 014 * * This program is free software; you can redistribute it and/or modify * 015 * * it under the terms of the GNU General Public License as published by * 016 * * the Free Software Foundation; either version 2 of the License, or * 017 * * (at your option) any later version. * 018 * * See also COPYING, LICENSE and WARRANTY file * 019 * * * 020 * * *********************************************************************** 021 */ 022 023package org.matsim.core.router.costcalculators; 024 025import org.matsim.core.config.groups.PlansCalcRouteConfigGroup; 026import org.matsim.core.controler.AbstractModule; 027 028public class TravelDisutilityModule extends AbstractModule { 029 030 @Override 031 public void install() { 032 PlansCalcRouteConfigGroup routeConfigGroup = getConfig().plansCalcRoute(); 033 for (String mode : routeConfigGroup.getNetworkModes()) { 034 035 final RandomizingTimeDistanceTravelDisutilityFactory builder = new RandomizingTimeDistanceTravelDisutilityFactory( mode, getConfig() ); 036 037 addTravelDisutilityFactoryBinding(mode ).toInstance( builder ); 038 } 039 } 040 041}