Skip to content

Commit

Permalink
extract matsim properties from beam.conf to matsim.conf (#1061)
Browse files Browse the repository at this point in the history
* extract matsim properties from beam.conf to matsim.conf

* fmt

* set param in beam config and referred in matsim config

* renaming and moving

* better default for iters

* remaining changes in extracting matsim config

* Merge remote-tracking branch 'remotes/origin/master' into rajnikantsh/#1008-extract-matsim-conf-4ci

# Conflicts:
#	test/input/sf-light/sf-light-1k.conf
reset agent number in sf-light-2.5k

* renaming and reogranizing params

* renaming and repositioning of sf-light

* fmt
  • Loading branch information
rajnikantsh authored and colinsheppard committed Jan 7, 2019
1 parent cc44d0f commit 5af0277
Show file tree
Hide file tree
Showing 19 changed files with 878 additions and 2,224 deletions.
2 changes: 1 addition & 1 deletion src/main/java/beam/utils/gtfs/OperatorDataUtility.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class OperatorDataUtility {
private String apiKey;

public OperatorDataUtility(BeamConfig config) {
opMapPath = config.beam().routing().gtfs().operatorsFile();
// opMapPath = config.beam().routing().gtfs().operatorsFile();
// apiKey=BEAM_CONFIG.beam().routing().gtfs().apiKey();
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/beam/utils/gtfs/SFBayPT2MATSim.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class SFBayPT2MATSim {
private String apiKey;

public SFBayPT2MATSim() {
outputDir = BEAM_CONFIG.beam().routing().gtfs().outputDir();
// outputDir = BEAM_CONFIG.beam().routing().gtfs().outputDir();
// apiKey = BEAM_CONFIG.beam().routing().gtfs().apiKey();
}

Expand Down Expand Up @@ -95,7 +95,7 @@ private void gtfs2Schedule(String agency, String agencyId) {
// [1] which service ids should be used.
"dayWithMostTrips",
// [2] the output coordinate system
BEAM_CONFIG.beam().routing().gtfs().crs(),
BEAM_CONFIG.beam().spatial().localCRS(),
// [3] output transit schedule file
String.format("%s%s/%s_UnmappedTransitSchedule.xml.gz", outputDir, agency, agencyId),
// [4] output default vehicles file (optional)
Expand Down
55 changes: 39 additions & 16 deletions src/main/resources/beam-template.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ beam.agentsim.thresholdForWalkingInMeters = 100
beam.agentsim.thresholdForMakingParkingChoiceInMeters = 100
beam.agentsim.schedulerParallelismWindow ="int | 30"
beam.agentsim.timeBinSize="int | 3600"
beam.agentsim.firstIteration="int | 0"
beam.agentsim.lastIteration="int | 0"
beam.agentsim.startTime="00:00:00"
beam.agentsim.endTime="30:00:00"

# MODE CHOICE OPTIONS:
# ModeChoiceMultinomialLogit ModeChoiceTransitIfAvailable ModeChoiceDriveIfAvailable ModeChoiceRideHailIfAvailable
Expand Down Expand Up @@ -71,6 +75,11 @@ beam.agentsim.agents.rideHail.allocationManager.repositionLowWaitingTimes.waitin
beam.agentsim.agents.rideHail.allocationManager.repositionLowWaitingTimes.demandWeight="double | 4.0"
beam.agentsim.agents.rideHail.allocationManager.repositionLowWaitingTimes.produceDebugImages=true

beam.agentsim.agents.plans.inputPlansFile = ${beam.inputDirectory}"/population.xml.gz"
beam.agentsim.agents.plans.inputPersonAttributesFile = ${beam.inputDirectory}"/populationAttributes.xml.gz"
beam.agentsim.agents.households.inputFile= ${beam.inputDirectory}"/households.xml.gz"
beam.agentsim.agents.households.inputHouseholdAttributesFile = ${beam.inputDirectory}"/householdAttributes.xml.gz"

beam.agentsim.agents.vehicles.bicycles.useBikes="boolean | false"
#BeamVehicles Params
beam.agentsim.agents.vehicles.beamFuelTypesFile = ${beam.inputDirectory}"/beamFuelTypes.csv"
Expand Down Expand Up @@ -108,6 +117,20 @@ beam.physsim.skipPhysSim = false
beam.physsim.eventsForFullVersionOfVia = true
beam.physsim.initializeRouterWithFreeFlowTimes = true
beam.physsim.quick_fix_minCarSpeedInMetersPerSecond = "double | 0.5"
beam.physsim.inputNetworkFile = ${beam.inputDirectory}"/r5/physsim-network.xml"


# Replanning
beam.replanning.maxAgentPlanMemorySize="int | 5"
beam.replanning.Module_1="SelectExpBeta"
beam.replanning.ModuleProbability_1=0.8
beam.replanning.Module_2="ClearRoutes"
beam.replanning.ModuleProbability_2=0.1
beam.replanning.Module_3="ClearModes"
beam.replanning.ModuleProbability_3=0.1
beam.replanning.Module_4="TimeMutator"
beam.replanning.ModuleProbability_4=0.0

##################################################################
# Warm Mode
##################################################################
Expand Down Expand Up @@ -326,7 +349,7 @@ matsim.conversion {
}

##################################################################
# BEAM ROUTING SERVICE
# BEAM ROUTING
##################################################################
beam.routing {
#Base local date in ISO 8061 YYYY-MM-DDTHH:MM:SS+HH:MM
Expand All @@ -342,16 +365,16 @@ beam.routing {
mNetBuilder.fromCRS = "EPSG:4326" # WGS84
mNetBuilder.toCRS = "EPSG:26910" # UTM10N
}
}

##################################################################
# GTFS Downloader Params
# Counts
##################################################################
gtfs {
operatorsFile = "src/main/resources/GTFSOperators.csv"
outputDir = ${beam.outputs.baseOutputDirectory}"/gtfs"
apiKey = ${?GTFS_API_KEY}
crs = "epsg:26910"
}
beam.calibration.counts {
countsScaleFactor = 10
writeCountsInterval = 1
averageCountsOverIterations = 1
inputCountsFile = ${beam.inputDirectory}"/counts.xml"
}

##################################################################
Expand All @@ -363,13 +386,13 @@ matsim.modules {
randomSeed = 4711
coordinateSystem = "Atlantis"
}
counts {
countsScaleFactor = 10.355
averageCountsOverIterations = 0
writeCountsInterval = 0
inputCountsFile = ""
outputformat = "all"
}
counts {
countsScaleFactor = 10.355
averageCountsOverIterations = 0
writeCountsInterval = 0
inputCountsFile = ""
outputformat = "all"
}
network {
inputNetworkFile = ${beam.inputDirectory}"/physsim-network.xml"
}
Expand Down Expand Up @@ -427,7 +450,7 @@ matsim.modules {
}
transit {
useTransit = false
vehiclesFile = ${beam.inputDirectory}/"transitVehicles.xml"
vehiclesFile = ""
transitModes = "pt"
}
changeMode {
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/beam/sim/BeamHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ trait BeamHelper extends LazyLogging {
.action(
(value, args) =>
args.copy(
config = Try(BeamConfigUtils.parseFileSubstitutingInputDirectory(value)).toOption,
config = Some(BeamConfigUtils.parseFileSubstitutingInputDirectory(value)),
configLocation = Option(value)
)
)
Expand Down Expand Up @@ -244,7 +244,7 @@ trait BeamHelper extends LazyLogging {
}
assert(
!isConfigArgRequired || (isConfigArgRequired && parsedArgs.config.isDefined),
"Beam config is a required, Please provide a valid configuration file."
"Please provide a valid configuration file."
)
val configLocation = parsedArgs.configLocation.get

Expand Down
Loading

0 comments on commit 5af0277

Please sign in to comment.