-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/msmobility/mito
� Conflicts: � pom.xml
- Loading branch information
Showing
143 changed files
with
12,811 additions
and
3,934 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Java CI | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 11 | ||
- name: Cache Maven packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2 | ||
- name: Build with Maven | ||
run: mvn test -Dhdf5lib-absolute-path=`pwd`/lib/linux64/libjhdf5.so --fail-at-end --batch-mode -Dmatsim.preferLocalDtds=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
pull_request_rules: | ||
- name: automatic merge when CI passes | ||
conditions: | ||
- status-success=continuous-integration/travis-ci/pr | ||
- base=master | ||
actions: | ||
merge: | ||
method: merge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
language: java | ||
dist: trusty | ||
jdk: | ||
- oraclejdk8 | ||
- openjdk11 | ||
jobs: | ||
include: | ||
- stage: test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
package de.tum.bgu.msm; | ||
|
||
import de.tum.bgu.msm.data.DataSet; | ||
import de.tum.bgu.msm.data.travelTimes.SkimTravelTimes; | ||
import de.tum.bgu.msm.io.input.readers.*; | ||
import de.tum.bgu.msm.resources.Properties; | ||
import de.tum.bgu.msm.resources.Resources; | ||
import de.tum.bgu.msm.util.ImplementationConfig; | ||
import de.tum.bgu.msm.util.MitoUtil; | ||
import org.apache.log4j.Logger; | ||
|
||
import java.util.Random; | ||
|
||
/** | ||
* Implements the Microsimulation Transport Orchestrator (MITO) | ||
* | ||
* @author Rolf Moeckel | ||
* Created on Sep 18, 2016 in Munich, Germany | ||
* <p> | ||
* To run MITO, the following data need either to be passed in from another program or | ||
* need to be read from files and passed in (using method initializeStandAlone): | ||
* - zones | ||
* - autoTravelTimes | ||
* - transitTravelTimes | ||
* - timoHouseholds | ||
* - retailEmplByZone | ||
* - officeEmplByZone | ||
* - otherEmplByZone | ||
* - totalEmplByZone | ||
* - sizeOfZonesInAcre | ||
*/ | ||
public final class MitoModel2 { | ||
|
||
private static final Logger logger = Logger.getLogger(MitoModel2.class); | ||
private final String scenarioName; | ||
|
||
private DataSet dataSet; | ||
|
||
private MitoModel2(DataSet dataSet, String scenarioName) { | ||
this.dataSet = dataSet; | ||
this.scenarioName = scenarioName; | ||
MitoUtil.initializeRandomNumber(); | ||
} | ||
|
||
public static MitoModel2 standAloneModel(String propertiesFile, ImplementationConfig config) { | ||
logger.info(" Creating standalone version of MITO "); | ||
Resources.initializeResources(propertiesFile); | ||
MitoModel2 model = new MitoModel2(new DataSet(), Resources.instance.getString(Properties.SCENARIO_NAME)); | ||
model.readStandAlone(config); | ||
return model; | ||
} | ||
|
||
public static MitoModel2 initializeModelFromSilo(String propertiesFile, DataSet dataSet, String scenarioName) { | ||
logger.info(" Initializing MITO from SILO"); | ||
Resources.initializeResources(propertiesFile); | ||
MitoModel2 model = new MitoModel2(dataSet, scenarioName); | ||
new OmxSkimsReader(dataSet).readOnlyTransitTravelTimes(); | ||
new OmxSkimsReader(dataSet).readSkimDistancesNMT(); | ||
new OmxSkimsReader(dataSet).readSkimDistancesAuto(); | ||
model.readAdditionalData(); | ||
return model; | ||
} | ||
|
||
public void run() { | ||
long startTime = System.currentTimeMillis(); | ||
logger.info("Started the Microsimulation Transport Orchestrator (MITO)"); | ||
|
||
TravelDemandGenerator2 ttd = new TravelDemandGenerator2.Builder(dataSet).build(); | ||
ttd.generateTravelDemand(scenarioName); | ||
printOutline(startTime); | ||
} | ||
|
||
private void readStandAlone(ImplementationConfig config) { | ||
dataSet.setYear(Resources.instance.getInt(Properties.SCENARIO_YEAR)); | ||
new ZonesReader(dataSet).read(); | ||
if (Resources.instance.getBoolean(Properties.REMOVE_TRIPS_AT_BORDER)) { | ||
new BorderDampersReader(dataSet).read(); | ||
} | ||
new JobReader(dataSet, config.getJobTypeFactory()).read(); | ||
new SchoolsReader(dataSet).read(); | ||
new HouseholdsReader(dataSet).read(); | ||
new HouseholdsCoordReader(dataSet).read(); | ||
new PersonsReader(dataSet).read(); | ||
dataSet.setTravelTimes(new SkimTravelTimes()); | ||
new OmxSkimsReader(dataSet).read(); | ||
readAdditionalData(); | ||
} | ||
|
||
private void readAdditionalData() { | ||
new TripAttractionRatesReader(dataSet).read(); | ||
new ModeChoiceInputReader(dataSet).read(); | ||
new EconomicStatusReader(dataSet).read(); | ||
new TimeOfDayDistributionsReader(dataSet).read(); | ||
new CalibrationDataReader(dataSet).read(); | ||
new CalibrationRegionMapReader(dataSet).read(); | ||
|
||
} | ||
|
||
private void printOutline(long startTime) { | ||
String trips = MitoUtil.customFormat(" " + "###,###", dataSet.getTrips().size()); | ||
logger.info("A total of " + trips.trim() + " microscopic trips were generated"); | ||
logger.info("Completed the Microsimulation Transport Orchestrator (MITO)"); | ||
float endTime = MitoUtil.rounder(((System.currentTimeMillis() - startTime) / 60000.f), 1); | ||
int hours = (int) (endTime / 60); | ||
int min = (int) (endTime - 60 * hours); | ||
logger.info("Runtime: " + hours + " hours and " + min + " minutes."); | ||
} | ||
|
||
public DataSet getData() { | ||
return dataSet; | ||
} | ||
|
||
public String getScenarioName() { | ||
return scenarioName; | ||
} | ||
|
||
public void setRandomNumberGenerator(Random random) { | ||
MitoUtil.initializeRandomNumber(random); | ||
} | ||
|
||
|
||
|
||
} |
Oops, something went wrong.