MATSIM
ChangeSingleLegMode.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.*
3  * ChangeLegMode.java
4  * *
5  * *********************************************************************** *
6  * *
7  * copyright : (C) 2008 by the members listed in the COPYING, *
8  * LICENSE and WARRANTY file. *
9  * email : info at matsim dot org *
10  * *
11  * *********************************************************************** *
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * See also COPYING, LICENSE and WARRANTY file *
18  * *
19  * *********************************************************************** */
20 
21 package org.matsim.core.replanning.modules;
22 
28 
50 
51  private String[] availableModes;
52  private boolean ignoreCarAvailability;
54 
55  public ChangeSingleLegMode(final GlobalConfigGroup globalConfigGroup, ChangeModeConfigGroup changeLegModeConfigGroup) {
56  super(globalConfigGroup.getNumberOfThreads());
57  this.availableModes = changeLegModeConfigGroup.getModes();
58  this.ignoreCarAvailability = changeLegModeConfigGroup.getIgnoreCarAvailability();
59  if (changeLegModeConfigGroup.getBehavior().equals(ChangeModeConfigGroup.Behavior.fromSpecifiedModesToSpecifiedModes)) {
60  this.allowSwitchFromListedModesOnly = true;
61  } else this.allowSwitchFromListedModesOnly=false;
62  }
63 
64  public ChangeSingleLegMode(final int nOfThreads, final String[] modes, final boolean ignoreCarAvailabilty) {
65  super(nOfThreads);
66  this.availableModes = modes.clone();
67  this.ignoreCarAvailability = ignoreCarAvailabilty;
68  }
69 
70  @Override
73  algo.setIgnoreCarAvailability(this.ignoreCarAvailability);
74  return algo;
75  }
76 
77 }
ChangeSingleLegMode(final GlobalConfigGroup globalConfigGroup, ChangeModeConfigGroup changeLegModeConfigGroup)
ChangeSingleLegMode(final int nOfThreads, final String[] modes, final boolean ignoreCarAvailabilty)