To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit f22754ec authored by Sebastian Hörl's avatar Sebastian Hörl
Browse files

Initial commit

parents
/target/
dependency-reduced-pom.xml
.settings
.project
.classpath
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ch.ethz.matsim.students_fs18</groupId>
<artifactId>zenhaeusern</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<matsim.preferLocalDtds>true</matsim.preferLocalDtds>
</properties>
<repositories>
<!-- Needed for geotools in matsim main -->
<repository>
<id>osgeo</id>
<name>Geotools repository</name>
<url>http://download.osgeo.org/webdav/geotools</url>
</repository>
<repository>
<id>matsim-eth</id>
<url>http://dl.bintray.com/matsim-eth/matsim</url>
</repository>
<repository>
<id>matsim-eth-packagecloud</id>
<url>https://packagecloud.io/eth-ivt/matsim/maven2</url>
</repository>
<repository>
<id>eth-playgrounds-packagecloud</id>
<url>https://packagecloud.io/eth-ivt/playgrounds/maven2</url>
</repository>
</repositories>
<profiles>
<profile>
<id>zip</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>ch.ethz.matsim.projects</groupId>
<artifactId>astra</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>ch.ethz.matsim</groupId>
<artifactId>baseline_scenario</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package ch.ethz.matsim.students_fs18.zenhaeusern;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.Scenario;
import org.matsim.contrib.dvrp.run.DvrpConfigGroup;
import org.matsim.contrib.dvrp.trafficmonitoring.DvrpTravelTimeModule;
import org.matsim.core.config.Config;
import org.matsim.core.config.ConfigUtils;
import org.matsim.core.controler.AbstractModule;
import org.matsim.core.controler.Controler;
import org.matsim.core.scenario.ScenarioUtils;
import org.matsim.vehicles.VehicleType;
import org.matsim.vehicles.VehicleTypeImpl;
import com.google.inject.name.Names;
import ch.ethz.matsim.av.framework.AVConfigGroup;
import ch.ethz.matsim.av.framework.AVModule;
import ch.ethz.matsim.av.routing.AVRoute;
import ch.ethz.matsim.av.routing.AVRouteFactory;
import ch.ethz.matsim.baseline_scenario.BaselineModule;
import ch.ethz.matsim.baseline_scenario.analysis.simulation.ModeShareListenerModule;
import ch.ethz.matsim.baseline_scenario.transit.BaselineTransitModule;
import ch.ethz.matsim.baseline_scenario.transit.routing.DefaultEnrichedTransitRoute;
import ch.ethz.matsim.baseline_scenario.transit.routing.DefaultEnrichedTransitRouteFactory;
import ch.ethz.matsim.baseline_scenario.zurich.ZurichModule;
import ch.ethz.matsim.projects.astra.analysis.AnalysisModule;
import ch.ethz.matsim.projects.astra.av.ASTRAAVModule;
import ch.ethz.matsim.projects.astra.av.ASTRAQSimModule;
import ch.ethz.matsim.projects.astra.av.pricing.AVPriceCalculationConfigGroup;
import ch.ethz.matsim.projects.astra.av.pricing.AVPriceCalculationModule;
import ch.ethz.matsim.projects.astra.av.waiting_time.AVWaitingTimeCalculatorConfigGroup;
import ch.ethz.matsim.projects.astra.av.waiting_time.AVWaitingTimeCalculatorModule;
import ch.ethz.matsim.projects.astra.av.waiting_time.kernel.KernelWaitingTimeCalculatorConfigGroup;
import ch.ethz.matsim.projects.astra.av.waiting_time.zonal.ZonalWaitingTimeCalculatorConfigGroup;
import ch.ethz.matsim.projects.astra.config.ASTRAConfigGroup;
import ch.ethz.matsim.projects.astra.mode_choice.ASTRAModeChoiceModule;
import ch.ethz.matsim.projects.astra.scoring.ASTRAScoringModule;
import ch.ethz.matsim.projects.astra.traffic.ASTRATrafficModule;
public class RunScenario {
static public void main(String[] args) {
Config config = ConfigUtils.loadConfig(args[0], new ASTRAConfigGroup(), new AVConfigGroup(),
new DvrpConfigGroup(), new AVPriceCalculationConfigGroup(), new AVWaitingTimeCalculatorConfigGroup(),
new KernelWaitingTimeCalculatorConfigGroup(), new ZonalWaitingTimeCalculatorConfigGroup());
double flowEfficiencyFactor = Double.parseDouble(args[1]);
Scenario scenario = ScenarioUtils.createScenario(config);
scenario.getPopulation().getFactory().getRouteFactories().setRouteFactory(AVRoute.class, new AVRouteFactory());
scenario.getPopulation().getFactory().getRouteFactories().setRouteFactory(DefaultEnrichedTransitRoute.class,
new DefaultEnrichedTransitRouteFactory());
ScenarioUtils.loadScenario(scenario);
Controler controler = new Controler(scenario);
controler.addOverridingModule(new DvrpTravelTimeModule());
controler.addOverridingModule(new AVModule());
controler.addOverridingModule(new BaselineModule());
controler.addOverridingModule(new BaselineTransitModule());
controler.addOverridingModule(new ZurichModule());
controler.addOverridingModule(new ASTRATrafficModule());
controler.addOverridingModule(new ASTRAScoringModule());
controler.addOverridingModule(new ASTRAModeChoiceModule());
controler.addOverridingModule(new ASTRAAVModule());
controler.addOverridingModule(new AnalysisModule());
controler.addOverridingModule(new ASTRAQSimModule());
controler.addOverridingModule(new AVWaitingTimeCalculatorModule());
controler.addOverridingModule(new AVPriceCalculationModule());
controler.addOverridingModule(new ModeShareListenerModule());
// Configure flow efficiency of shared AVs
VehicleType avType = new VehicleTypeImpl(Id.create("sav", VehicleType.class));
avType.setFlowEfficiencyFactor(flowEfficiencyFactor);
controler.addOverridingModule(new AbstractModule() {
@Override
public void install() {
bind(VehicleType.class).annotatedWith(Names.named(AVModule.AV_MODE)).toInstance(avType);
}
});
controler.run();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment