All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.kit.ifv.mobitopp.populationsynthesis.region.ProcessOnLowerRegionLevelStep Maven / Gradle / Ivy

Go to download

mobiTopp (http://mobitopp.ifv.kit.edu/) is an agent-based travel demand model developed at the Institute for transport studies at the Karlsruhe Institute of Technology (http://www.ifv.kit.edu/english/index.php). Publications about mobiTopp can be found on the project site (http://mobitopp.ifv.kit.edu/28.php).

The newest version!
package edu.kit.ifv.mobitopp.populationsynthesis.region;

import java.util.List;

import edu.kit.ifv.mobitopp.data.DemandRegion;
import edu.kit.ifv.mobitopp.populationsynthesis.RegionalLevel;

public class ProcessOnLowerRegionLevelStep implements PopulationSynthesisStep {

  private final PopulationSynthesisStep other;
  private final RegionalLevel expectedLevel;

  public ProcessOnLowerRegionLevelStep(
      final PopulationSynthesisStep other, final RegionalLevel expectedLevel) {
    this.other = other;
    this.expectedLevel = expectedLevel;
  }

  @Override
  public void process(final DemandRegion region) {
    if (expectedLevel.equals(region.regionalLevel())) {
      other.process(region);
      return;
    }
    processPartsOf(region);
  }

  private void processPartsOf(final DemandRegion region) {
    List parts = region.parts();
    for (DemandRegion part : parts) {
      process(part);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy