Skip to content

Commit

Permalink
initial files and matsim dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
dziemke committed May 23, 2018
1 parent dc1105f commit 354b32a
Show file tree
Hide file tree
Showing 14 changed files with 2,212 additions and 619 deletions.
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
*.class

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.ear

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
/.settings/
/.project
/.classpath
/target/
/output/
/bin/

/.idea/
*.iml

*.DS_STORE
6 changes: 6 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
image: maven:3-jdk-7

build:
script: "mvn install -B --fail-at-end -B -Dmaven.test.redirectTestOutputToFile -Dmatsim.preferLocalDtds=true"

# see http://stackoverflow.com/questions/33430487/how-to-use-gitlab-ci-to-build-a-java-maven-project
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
language: java
904 changes: 285 additions & 619 deletions LICENSE

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# matsim-example-project

A small example of how to use MATSim as a library.

By default, this project uses the latest (pre-)release. In order to use a different version, edit `pom.xml`.
91 changes: 91 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<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>org.matsim</groupId>
<artifactId>matsim-example-project</artifactId>
<version>0.0.1-SNAPSHOT</version>

<name>MATSim example project</name>
<description>MATSim example project</description>

<repositories>
<!-- Repository for MATSim releases (MATSim is not on Maven central) -->
<repository>
<id>matsim</id>
<url>https://dl.bintray.com/matsim/matsim</url>
</repository>
</repositories>

<dependencies>
<!-- This is the matsim "core": -->
<dependency>
<groupId>org.matsim</groupId>
<artifactId>matsim</artifactId>
<version>0.10.0</version>
</dependency>

<!-- Include the JUnit testing library -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<showWarnings>false</showWarnings>
<showDeprecation>false</showDeprecation>
<encoding>UTF-8</encoding>
<!-- configure initial and maximal memory for compiling -->
<fork>true</fork>
<meminitial>128m</meminitial>
<maxmem>512m</maxmem>
<compilerArguments>
<Xmaxwarns>4000</Xmaxwarns>
<Xmaxerrs>100</Xmaxerrs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>org.matsim.gui.MATSimGUI</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
67 changes: 67 additions & 0 deletions scenarios/equil/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" ?>
<!DOCTYPE config SYSTEM "http://www.matsim.org/files/dtd/config_v2.dtd">
<config>

<module name="global">
<param name="randomSeed" value="4711" />
<param name="coordinateSystem" value="Atlantis" />
</module>

<module name="network">
<param name="inputNetworkFile" value="network.xml" />
</module>

<module name="plans">
<param name="inputPlansFile" value="plans100.xml" />
</module>

<module name="controler">
<param name="outputDirectory" value="./output" />
<param name="firstIteration" value="0" />
<param name="lastIteration" value="10" />
</module>

<module name="qsim">
<!-- "start/endTime" of MobSim (00:00:00 == take earliest activity time/ run as long as active vehicles exist) -->
<param name="startTime" value="00:00:00" />
<param name="endTime" value="00:00:00" />

<param name = "snapshotperiod" value = "00:00:00"/> <!-- 00:00:00 means NO snapshot writing -->
</module>

<module name="planCalcScore">
<param name="learningRate" value="1.0" />
<param name="BrainExpBeta" value="2.0" />

<param name="lateArrival" value="-18" />
<param name="earlyDeparture" value="-0" />
<param name="performing" value="+6" />
<param name="traveling" value="-6" />
<param name="waiting" value="-0" />

<param name="activityType_0" value="h" /> <!-- home -->
<param name="activityPriority_0" value="1" />
<param name="activityTypicalDuration_0" value="12:00:00" />
<param name="activityMinimalDuration_0" value="08:00:00" />

<param name="activityType_1" value="w" /> <!-- work -->
<param name="activityPriority_1" value="1" />
<param name="activityTypicalDuration_1" value="08:00:00" />
<param name="activityMinimalDuration_1" value="06:00:00" />
<param name="activityOpeningTime_1" value="07:00:00" />
<param name="activityLatestStartTime_1" value="09:00:00" />
<param name="activityEarliestEndTime_1" value="" />
<param name="activityClosingTime_1" value="18:00:00" />
</module>

<module name="strategy">
<param name="maxAgentPlanMemorySize" value="5" /> <!-- 0 means unlimited -->

<param name="ModuleProbability_1" value="0.9" />
<param name="Module_1" value="BestScore" />

<param name="ModuleProbability_2" value="0.1" />
<param name="Module_2" value="ReRoute" />
</module>

</config>
112 changes: 112 additions & 0 deletions scenarios/equil/counts100.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8"?>

<counts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://matsim.org/files/dtd/counts_v1.xsd"
name="equilCounts" desc="hand made values for counting stations for the equil-example with 100 plans"
year="2008" layer="0">
<!-- in a equilibrium state, there should be the same amount of vehicles
on the 9 alternative routes. 100 vehicles / 9 routes = 11.1 veh/route -->
<count loc_id="14" cs_id="handmade_01">
<volume h="1" val="0" />
<volume h="2" val="0" />
<volume h="3" val="0" />
<volume h="4" val="0" />
<volume h="5" val="0" />
<volume h="6" val="0" />
<volume h="7" val="11.1" />
<volume h="8" val="0" />
<volume h="9" val="0" />
<volume h="10" val="0" />
<volume h="11" val="0" />
<volume h="12" val="0" />
<volume h="13" val="0" />
<volume h="14" val="0" />
<volume h="15" val="0" />
<volume h="16" val="0" />
<volume h="17" val="0" />
<volume h="18" val="0" />
<volume h="19" val="0" />
<volume h="20" val="0" />
<volume h="21" val="0" />
<volume h="22" val="0" />
<volume h="23" val="0" />
<volume h="24" val="0" />
</count>
<count loc_id="15" cs_id="handmade_02">
<volume h="1" val="0" />
<volume h="2" val="0" />
<volume h="3" val="0" />
<volume h="4" val="0" />
<volume h="5" val="0" />
<volume h="6" val="0" />
<volume h="7" val="11.1" />
<volume h="8" val="0" />
<volume h="9" val="0" />
<volume h="10" val="0" />
<volume h="11" val="0" />
<volume h="12" val="0" />
<volume h="13" val="0" />
<volume h="14" val="0" />
<volume h="15" val="0" />
<volume h="16" val="0" />
<volume h="17" val="0" />
<volume h="18" val="0" />
<volume h="19" val="0" />
<volume h="20" val="0" />
<volume h="21" val="0" />
<volume h="22" val="0" />
<volume h="23" val="0" />
<volume h="24" val="0" />
</count>
<count loc_id="16" cs_id="handmade_03">
<volume h="1" val="0" />
<volume h="2" val="0" />
<volume h="3" val="0" />
<volume h="4" val="0" />
<volume h="5" val="0" />
<volume h="6" val="0" />
<volume h="7" val="11.1" />
<volume h="8" val="0" />
<volume h="9" val="0" />
<volume h="10" val="0" />
<volume h="11" val="0" />
<volume h="12" val="0" />
<volume h="13" val="0" />
<volume h="14" val="0" />
<volume h="15" val="0" />
<volume h="16" val="0" />
<volume h="17" val="0" />
<volume h="18" val="0" />
<volume h="19" val="0" />
<volume h="20" val="0" />
<volume h="21" val="0" />
<volume h="22" val="0" />
<volume h="23" val="0" />
<volume h="24" val="0" />
</count>
<count loc_id="21" cs_id="handmade_04">
<volume h="1" val="0" />
<volume h="2" val="0" />
<volume h="3" val="0" />
<volume h="4" val="0" />
<volume h="5" val="0" />
<volume h="6" val="0" />
<volume h="7" val="90" />
<volume h="8" val="5" />
<volume h="9" val="1" />
<volume h="10" val="1" />
<volume h="11" val="1" />
<volume h="12" val="1" />
<volume h="13" val="1" />
<volume h="14" val="0" />
<volume h="15" val="0" />
<volume h="16" val="0" />
<volume h="17" val="0" />
<volume h="18" val="0" />
<volume h="19" val="0" />
<volume h="20" val="0" />
<volume h="21" val="0" />
<volume h="22" val="0" />
<volume h="23" val="0" />
<volume h="24" val="0" />
</count>
</counts>
47 changes: 47 additions & 0 deletions scenarios/equil/network.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE network SYSTEM "http://www.matsim.org/files/dtd/network_v1.dtd">

<network name="equil test network">
<nodes>
<node id="1" x="-20000" y="0"/>
<node id="2" x="-15000" y="0"/>
<node id="3" x="-865" y="5925"/>
<node id="4" x="-2498" y="4331"/>
<node id="5" x="-3829" y="3215"/>
<node id="6" x="-4698" y="1711"/>
<node id="7" x="-5000" y="0"/>
<node id="8" x="-4698" y="-1711"/>
<node id="9" x="-3829" y="-3215"/>
<node id="10" x="-2498" y="-4331"/>
<node id="11" x="-865" y="-5925"/>
<node id="12" x="0" y="0"/>
<node id="13" x="5000" y="0"/>
<node id="14" x="5000" y="-10000"/>
<node id="15" x="-20000" y="-10000"/>
</nodes>
<links capperiod="01:00:00">
<link id="1" from="1" to="2" length="10000.00" capacity="36000" freespeed="27.78" permlanes="1" />
<link id="2" from="2" to="3" length="10000.00" capacity="3600" freespeed="27.78" permlanes="1" />
<link id="3" from="2" to="4" length="10000.00" capacity="3600" freespeed="27.78" permlanes="1" />
<link id="4" from="2" to="5" length="10000.00" capacity="3600" freespeed="27.78" permlanes="1" />
<link id="5" from="2" to="6" length="10000.00" capacity="3600" freespeed="27.78" permlanes="1" />
<link id="6" from="2" to="7" length="10000.00" capacity="3600" freespeed="27.78" permlanes="1" />
<link id="7" from="2" to="8" length="10000.00" capacity="3600" freespeed="27.78" permlanes="1" />
<link id="8" from="2" to="9" length="10000.00" capacity="3600" freespeed="27.78" permlanes="1" />
<link id="9" from="2" to="10" length="10000.00" capacity="3600" freespeed="27.78" permlanes="1" />
<link id="10" from="2" to="11" length="10000.00" capacity="3600" freespeed="27.78" permlanes="1" />
<link id="11" from="3" to="12" length="5000.00" capacity="1000" freespeed="27.78" permlanes="1" />
<link id="12" from="4" to="12" length="5000.00" capacity="1000" freespeed="27.78" permlanes="1" />
<link id="13" from="5" to="12" length="5000.00" capacity="1000" freespeed="27.78" permlanes="1" />
<link id="14" from="6" to="12" length="5000.00" capacity="1000" freespeed="27.78" permlanes="1" />
<link id="15" from="7" to="12" length="5000.00" capacity="1000" freespeed="27.78" permlanes="1" />
<link id="16" from="8" to="12" length="5000.00" capacity="1000" freespeed="27.78" permlanes="1" />
<link id="17" from="9" to="12" length="5000.00" capacity="1000" freespeed="27.78" permlanes="1" />
<link id="18" from="10" to="12" length="5000.00" capacity="1000" freespeed="27.78" permlanes="1" />
<link id="19" from="11" to="12" length="5000.00" capacity="1000" freespeed="27.78" permlanes="1" />
<link id="20" from="12" to="13" length="10000.00" capacity="36000" freespeed="27.78" permlanes="1" />
<link id="21" from="13" to="14" length="10000.00" capacity="36000" freespeed="27.78" permlanes="1" />
<link id="22" from="14" to="15" length="35000.00" capacity="36000" freespeed="27.78" permlanes="1" />
<link id="23" from="15" to="1" length="10000.00" capacity="36000" freespeed="27.78" permlanes="1" />
</links>
</network>
Loading

0 comments on commit 354b32a

Please sign in to comment.